diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-04 10:14:10 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-04 10:14:10 -0700 |
commit | b13849de88cb330aaedee0881862ea55bfa33c85 (patch) | |
tree | 6f12e128297ef19ba0a8be3be826a9aeb14ca133 /guides/code/getting_started/app/controllers | |
parent | c4f02295df74ed4e09b664dd5bf3d00a5aa9b6a4 (diff) | |
parent | 510cf0ad93f07e9285178c8b7ba7d4d68c139fec (diff) | |
download | rails-b13849de88cb330aaedee0881862ea55bfa33c85.tar.gz rails-b13849de88cb330aaedee0881862ea55bfa33c85.tar.bz2 rails-b13849de88cb330aaedee0881862ea55bfa33c85.zip |
Merge branch 'master' into session
* master: (55 commits)
extract deprecated dynamic methods
Add some docs and changelog entry
Allow overriding exception handling in threaded consumer
Allow configuring a different queue consumer
actually don't need to expand the aggregates at all
#to_sym is unnecessary
de-globalise method
extract code from AR::Base
clean up implementation of dynamic methods. use method compilation etc.
Fix ActiveModel README example
mention database mapping in getting started guide
Remove vestiges of the http_only! config from configuring guide
Remove content-length as well
Make ActionController#head pass rack-link
RouteSet: optimize routes generation when globbing is used
Allows assert_redirected_to to accept a regular expression
use extract_options!
No need to force conversion to Symbol since case ensures it's already one.
No need to work around 1.8 warnings anymore.
Update command line guide
...
Diffstat (limited to 'guides/code/getting_started/app/controllers')
-rw-r--r-- | guides/code/getting_started/app/controllers/comments_controller.rb | 5 | ||||
-rw-r--r-- | guides/code/getting_started/app/controllers/posts_controller.rb | 2 |
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 |