Skip to content

Instantly share code, notes, and snippets.

@PeteMichaud
Created June 7, 2012 23:13
Show Gist options
  • Save PeteMichaud/2892275 to your computer and use it in GitHub Desktop.
Save PeteMichaud/2892275 to your computer and use it in GitHub Desktop.
<% form_for info, :html => { :class => 'form-horizontal' } do |f| %>
<div class='control-group<%= " error" if info.errors.has_key?(:lawfirm) %>'>
<label class='control-label'>Firm</label>
<div class='controls'>
<%= f.collection_select :lawfirm_id, Lawfirm.all, :id, :name %>
<% if info.errors.has_key?(:lawfirm) %>
<span class='help-inline'>Lawfirm <%= info.errors.get(:lawfirm).first %></span>
<% end %>
</div>
</div>
<div class='control-group<%= " error" if info.errors.has_key?(:lawyer) %>'>
<label class='control-label'>Lawyer</label>
<div class='controls'>
<%= f.collection_select :lawyer_id, User.all, :id, :fullname %>
<% if info.errors.has_key?(:lawyer) %>
<span class='help-inline'>Lawyer <%= info.errors.get(:lawyer).first %></span>
<% end %>
</div>
</div>
<div class='control-group<%= " error" if info.errors.has_key?(:for) %>'>
<label class='control-label'>For</label>
<div class='controls'>
<%= f.enum_select :for %>
<% if info.errors.has_key?(:for) %>
<span class='help-inline'>For <%= info.errors.get(:for).first %></span>
<% end %>
</div>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment