Class: PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PagesController
- Defined in:
- app/controllers/pages_controller.rb
Instance Method Summary collapse
- #show ⇒ Object
-
#view_context ⇒ Object
NOTE: This is super naughty! Rails really doesn’t want you to use content_for in controllers, so we have to jump through this ridiculous hoop.
Instance Method Details
#show ⇒ Object
2 3 4 |
# File 'app/controllers/pages_controller.rb', line 2 def show @page = Page.find_by_path(params[:path]) end |
#view_context ⇒ Object
NOTE: This is super naughty! Rails really doesn’t want you to use content_for in controllers,
so we have to jump through this ridiculous hoop. Shouldn't do this.
see gist.github.com/hiroshi/985457 see github.com/clmntlxndr/content_for_in_controllers
11 12 13 |
# File 'app/controllers/pages_controller.rb', line 11 def view_context super.tap { |actual_view_context| actual_view_context.content_for :meta_description, @page. } end |