Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Created May 21, 2013 18:33
Show Gist options
  • Save ethagnawl/5622142 to your computer and use it in GitHub Desktop.
Save ethagnawl/5622142 to your computer and use it in GitHub Desktop.
Using locals in views. Inspired by @henrik.
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