Created
December 4, 2009 20:01
-
-
Save jkeck/249308 to your computer and use it in GitHub Desktop.
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
<%= some_text("LOCATION1") %> | |
<!-- This will only load once, and fail upon refresh --> |
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
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 |
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
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