diff options
author | Lucas Mazza <luc4smazza@gmail.com> | 2012-07-24 16:19:14 -0300 |
---|---|---|
committer | Lucas Mazza <luc4smazza@gmail.com> | 2012-07-24 16:19:14 -0300 |
commit | 9a020bd8f924895c5e064b913df383b8ed77ac2a (patch) | |
tree | 2ddf0baccc8439fd639014dfcf5409f1fe768c28 /actionpack/lib/action_view | |
parent | 66b859bd9e7138b27902805721309ce03b722de3 (diff) | |
download | rails-9a020bd8f924895c5e064b913df383b8ed77ac2a.tar.gz rails-9a020bd8f924895c5e064b913df383b8ed77ac2a.tar.bz2 rails-9a020bd8f924895c5e064b913df383b8ed77ac2a.zip |
Replace the flush parameter with a Hash.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/capture_helper.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb index 397738dd98..9186855319 100644 --- a/actionpack/lib/action_view/helpers/capture_helper.rb +++ b/actionpack/lib/action_view/helpers/capture_helper.rb @@ -134,7 +134,7 @@ module ActionView # # <%# Add some other content, or use a different template: %> # - # <% content_for :navigation, true do %> + # <% content_for :navigation, flush: true do %> # <li><%= link_to 'Login', :action => 'login' %></li> # <% end %> # @@ -148,14 +148,14 @@ module ActionView # # WARNING: content_for is ignored in caches. So you shouldn't use it # for elements that will be fragment cached. - def content_for(name, content = nil, flush = false, &block) + def content_for(name, content = nil, options = {}, &block) if content || block_given? if block_given? - flush = content if content + options = content if content content = capture(&block) end if content - flush ? @view_flow.set(name, content) : @view_flow.append(name, content) + options[:flush] ? @view_flow.set(name, content) : @view_flow.append(name, content) end nil else |