Skip to content

Instantly share code, notes, and snippets.

@mustmodify
Last active May 1, 2019 19:25
Show Gist options
  • Save mustmodify/9941977 to your computer and use it in GitHub Desktop.
Save mustmodify/9941977 to your computer and use it in GitHub Desktop.
RubyHotline: helpers in helpers
module NavigationHelper
def conditional_render( yesno )
yield if yesno && block_given?
end
- conditional_render(true) do
%h1 Lucky!
= render 'pages/got_here'
- conditional_render(false) do
%h1 Unfortunate
= render 'pages/got_here'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment