aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-05-02 11:39:36 +0200
committerOscar Del Ben <info@oscardelben.com>2012-05-02 11:40:25 +0200
commitc55ee776232f77a9bd45684a3e6f3f3b13380e4c (patch)
tree7bf2c17589e494d69f106afc1758dfa923127199 /guides/code/getting_started
parent323d2c42c3782db9e30b37abb4787fe73d6d7c8d (diff)
downloadrails-c55ee776232f77a9bd45684a3e6f3f3b13380e4c.tar.gz
rails-c55ee776232f77a9bd45684a3e6f3f3b13380e4c.tar.bz2
rails-c55ee776232f77a9bd45684a3e6f3f3b13380e4c.zip
Remove tags from getting started guide and adapt some of the content to
the new guide
Diffstat (limited to 'guides/code/getting_started')
-rw-r--r--guides/code/getting_started/app/controllers/comments_controller.rb5
-rw-r--r--guides/code/getting_started/app/controllers/posts_controller.rb2
2 files changed, 5 insertions, 2 deletions
diff --git a/guides/code/getting_started/app/controllers/comments_controller.rb b/guides/code/getting_started/app/controllers/comments_controller.rb
index 7447fd078b..cf3d1be42e 100644
--- a/guides/code/getting_started/app/controllers/comments_controller.rb
+++ b/guides/code/getting_started/app/controllers/comments_controller.rb
@@ -1,16 +1,17 @@
class CommentsController < ApplicationController
http_basic_authenticate_with :name => "dhh", :password => "secret", :only => :destroy
+
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create(params[:comment])
redirect_to post_path(@post)
end
-
+
def destroy
@post = Post.find(params[:post_id])
@comment = @post.comments.find(params[:id])
@comment.destroy
redirect_to post_path(@post)
end
-
+
end
diff --git a/guides/code/getting_started/app/controllers/posts_controller.rb b/guides/code/getting_started/app/controllers/posts_controller.rb
index 85d2c1de47..a8ac9aba5a 100644
--- a/guides/code/getting_started/app/controllers/posts_controller.rb
+++ b/guides/code/getting_started/app/controllers/posts_controller.rb
@@ -1,5 +1,7 @@
class PostsController < ApplicationController
+ http_basic_authenticate_with :name => "dhh", :password => "secret", :except => [:index, :show]
+
def index
@posts = Post.all
end