Created
December 17, 2011 22:57
-
-
Save mahemoff/1491704 to your computer and use it in GitHub Desktop.
check if local variable is true/false in rails template (even if undefined)
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
/default is "true". this will also work with default "false"(by changing "true" below to "false"). | |
- if ( local_assigns.has_key?(:show_message) ? show_message : true ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment