Skip to content

Instantly share code, notes, and snippets.

@taiansu
Created November 12, 2012 17:30
Show Gist options
  • Save taiansu/4060695 to your computer and use it in GitHub Desktop.
Save taiansu/4060695 to your computer and use it in GitHub Desktop.
Bootstrap _form validation
<%= simple_form_for @record, :html => { :class => 'form-horizontal' } do |f| %>
<fieldset>
<legend><%= controller.action_name.capitalize %></legend>
<%= f.input :title %>
<%= f.input :amount %>
<%= f.association :category %>
<%= f.input :date %>
<div class="form-actions">
<%= f.submit nil, :class => 'btn btn-primary' %>
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
records_path, :class => 'btn' %>
</div>
</fieldset>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment