Enables content_for in controllers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
Gemfile
Gemfile.lock
Rakefile
content_for_in_controllers.gemspec
readme.md

readme.md

content_for in controllers

Enables use of content_for in your controllers

# in your Gemfile
gem 'content_for_in_controllers'

# in a controller 
before_filter :set_title

def set_title
  content_for :page_title, "Hello !"
end

# in a view
<title><%= yield :page_title %></title>

You just can pass strings for now, and I have no precise idea how it would work in an ActionMailer view :)

Simply this gist by hiroshi Gemified

Say hello @clmntlxndr