Created
May 21, 2012 19:51
-
-
Save joncode/2764257 to your computer and use it in GitHub Desktop.
instance variables into Partials
This file contains hidden or 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 'option_associations',option: option, collection:[ @body_types, @themes, @products] %> | |
| in this example, instance variables are @options, @body_types, @themes, @products | |
| @options.each do |option| | |
| --- partial is rendered with option and the collection instance variables ... | |
| use collection: to push instance variables into a partial | |
| use option: option -- to push local variable into partial as local variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment