Created
May 21, 2013 18:33
-
-
Save ethagnawl/5622142 to your computer and use it in GitHub Desktop.
Using locals in views. Inspired by @henrik.
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
def show | |
locals item: Item.find(params[:id]) | |
end | |
def locals(hash) | |
render locals: hash | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment