Skip to content

Instantly share code, notes, and snippets.

@jkeck
Created December 4, 2009 20:01
Show Gist options
  • Save jkeck/249308 to your computer and use it in GitHub Desktop.
Save jkeck/249308 to your computer and use it in GitHub Desktop.
<%= some_text("LOCATION1") %>
<!-- This will only load once, and fail upon refresh -->
module ApplicationHelper
def some_text(loc)
if Constants::SOME_LOCATIONS.include?(loc)
"This is a valid location"
else
"This is not a valid location"
end
end
end
module Constants
SOME_LOCATIONS = ["LOCATION1","LOCATION2"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment