Skip to content

Instantly share code, notes, and snippets.

@jlong
Forked from ericdfields/gist:1118821
Created August 1, 2011 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlong/1118832 to your computer and use it in GitHub Desktop.
Save jlong/1118832 to your computer and use it in GitHub Desktop.
# This should be in view_helpers.rb:
def logged_in?
boolean_param(:logged_in)
end
# my template code
<% unless logged_in? %>
<script type="text/javascript" charset="utf-8">
alert('done')
</script>
<% end %>
# Now if you hit /template-name?logged_in=true the code above will not render
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment