This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= render :partial => 'thing_one', :locals => { :foo => '123' } %> | |
<%= render 'thing_one', :foo => '123' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# A trick so you can have partials that take blocks. | |
# Uses render :layout. | |
# | |
# Example: | |
# <%= block_render 'some_partial_with_a_yield', :foo => 123 do %> | |
# Any erb here... | |
# <% end %> | |
# | |
def block_render(partial_name, locals={}) | |
render :layout => partial_name, :locals => locals do | |
yield | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= block_render 'block_thing', :foo => '123' do %> | |
stuff inside here | |
<% end %> |
No comments:
Post a Comment