Skip to content

Instantly share code, notes, and snippets.

@glennmartinez
Created September 25, 2012 13:11
Show Gist options
  • Select an option

  • Save glennmartinez/3781725 to your computer and use it in GitHub Desktop.

Select an option

Save glennmartinez/3781725 to your computer and use it in GitHub Desktop.
<%= nested_form_for [@project, @quote], :html => {:class =>'form-inline'} do |f| %>
<div>
<%= f.hidden_field :project_id %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :status %>
<%= f.text_field :status %>
</div>
<p>
<h4> Labour Items </h4>
</p>
<p>
<%= f.fields_for :labouritems, :html => { :class => 'form-vertical' } do |builder| %>
<%= builder.label :description %>
<%= builder.text_field :description, :class => "input-medium" %>
<%= builder.label "Contractor" %>
<%= builder.autocomplete_field :contractor_name, autocomplete_contractor_firstname_contractors_path, :update_elements => {:id => '#quote_labouritems_attributes_0_contractor_id', :hourly_rate => '#quote_labouritems_attributes_0_contractor_rate'},:class => "input-small",:placeholder => "Seach" %>
<%= builder.hidden_field :contractor_id %>
<%= builder.label "Rate/hr" %>
<%= builder.text_field :contractor_rate,:class => "input-mini" %>
<%= builder.link_to_remove "Delete",:class => 'btn btn-small btn-danger' %>
<% end %>
<%= f.submit "Submit" %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment