Created
November 6, 2015 06:44
-
-
Save royzinn/7e3b6d01113ce6d8ebb3 to your computer and use it in GitHub Desktop.
content + partial
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
# Controller( UsersController ): | |
def do_something | |
@some_var = some_value | |
@some_other_var = some_other_value | |
# additional controller logic | |
render :do_something # this is not required if the view has the same name (i.e., app/views/users/do_something.html.erb) | |
end | |
# in the view (app/views/users/do_something.html.erb) | |
<%= render partial: partial_name, locals: { local_var_name: @some_var } %> | |
<h1> Here we put all the other HTML that we want</h1> | |
<p> .... </p> | |
<%= render partial: partial_name, locals: { local_var_name: @some_other_var } %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment