Created
January 31, 2012 12:52
-
-
Save JohnPlummer/1710343 to your computer and use it in GitHub Desktop.
Optional Parameters in View Partials
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
render 'shared/events_table', events: @events, title: 'Your Events' |
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
render 'shared/events_table', events: @user.events, title: 'Your Events' | |
render 'shared/events_table', events: @team.events, title: "Your Team's Events" |
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
- events = [] unless defined? events | |
- title = 'Events' unless defined? title |
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
- events = [] unless local_assigns.has_key? :events | |
- title = 'Events' local_assigns.has_key? :title |
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
- events ||= [] | |
- title ||= 'Events' |
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
- result ||= nil | |
- result ||= false |
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
- result ||= result.nil? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment