Skip to content
Browse files

In rails 3.2 you need to use layout: false instead of layout: nil to …

…avoid rendering the layout twice.
  • Loading branch information...
1 parent e735afc commit cd4328d2291b1899c9a846858a587b92ac462b68 @quamen quamen committed May 10, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 README.md
View
6 README.md
@@ -145,22 +145,22 @@ We also need to instruct the `PostsController` not to wrap the view in a layout
# app/controllers/posts_controller.rb
class PostsController < ApplicationController
def index
- render :layout => nil
+ render :layout => false
end
end
Or for an entire controller:
# app/controllers/posts_controller.rb
class PostsController < ApplicationController
- layout nil
+ layout false
end
Or for every controller:
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
- layout nil
+ layout false
end
We'll find a way to make this easier or a bit more obvious in a future version.

0 comments on commit cd4328d

Please sign in to comment.
Something went wrong with that request. Please try again.