diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-07-24 12:24:01 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-07-24 12:24:01 -0700 |
commit | d7856d3fad5cf61beaca997b9757b181c4821b86 (patch) | |
tree | 2ddf0baccc8439fd639014dfcf5409f1fe768c28 /actionpack/lib | |
parent | 66b859bd9e7138b27902805721309ce03b722de3 (diff) | |
parent | 9a020bd8f924895c5e064b913df383b8ed77ac2a (diff) | |
download | rails-d7856d3fad5cf61beaca997b9757b181c4821b86.tar.gz rails-d7856d3fad5cf61beaca997b9757b181c4821b86.tar.bz2 rails-d7856d3fad5cf61beaca997b9757b181c4821b86.zip |
Merge pull request #7150 from lucasmazza/flush_option
Replace the flush parameter with a Hash.
Diffstat (limited to 'actionpack/lib')
-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 |