Skip to content

Instantly share code, notes, and snippets.

@zorn
Created October 20, 2011 21:14
Show Gist options
  • Save zorn/1302408 to your computer and use it in GitHub Desktop.
Save zorn/1302408 to your computer and use it in GitHub Desktop.
There has got to be a clean way to do this...
<% if @event.main_venue.blank? %>
<div id="behavior_form_main_venue_form" class="behavior_form hide">
<% else %>
<div id="behavior_form_main_venue_form" class="behavior_form">
<% end %>
@r38y
Copy link

r38y commented Oct 20, 2011

You can have a helper that outputs classes based on a venue that has been passed. Or, you can create a presenter class, pass it a venue, then have methods such as "form_classes" that outputs the classes based on the condition.

@zorn
Copy link
Author

zorn commented Oct 20, 2011

Thanks for the help guys. Also related:

https://gist.github.com/1302462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment