Skip to content

Instantly share code, notes, and snippets.

@jeremytregunna
Created August 3, 2011 02:01
Show Gist options
  • Select an option

  • Save jeremytregunna/1121722 to your computer and use it in GitHub Desktop.

Select an option

Save jeremytregunna/1121722 to your computer and use it in GitHub Desktop.
<%= form_for @company do |f| %>
<% if @account_id %>
<%= f.hidden_field :account_id, :value => @account_id %>
<% end %>
<p>
<%= f.label :name, "Company Name" %>
<%= f.text_field :name %>
</p>
<%= fields_for :address do |a| %>
<p>
<%= a.label :street1, "Address 1" %>
<%= a.text_field :street1 %>
</p>
<p>
<%= a.label :street2, "Address 2" %>
<%= a.text_field :street2 %>
</p>
<p>
<%= a.label :city %>
<%= a.text_field :city %>
</p>
<p>
<%= a.label :state %>
<%= a.text_field :state %>
</p>
<p>
<%= a.label :zipcode %>
<%= a.text_field :zipcode %>
</p>
<p>
<%= a.label :country %>
<%= select_tag :address_country, options_for_select(countries_list.unshift("")), :selected => "", :tabindex => "1", :class => "chzn-select" %>
</p>
<% end %>
<p>
<%= f.label :language %>
<%= select_tag :company_language, options_for_select(languages_list.unshift("")), :selected => "", :tabindex => "1", :class => "chzn-select" %>
</p>
<p>
<%= f.label :time_zone %>
<%= f.time_zone_select :time_zone %>
</p>
<p>
<%= f.label :website %>
<%= f.text_field :website %>
</p>
<p>
<%= f.label :phone %>
<%= f.text_field :phone %>
</p>
<p>
<%= f.label :fax %>
<%= f.text_field :fax %>
</p>
<%= f.submit "Submit" %>
<% end %>
<script type="text/javascript"> $(".chzn-select").chosen(); </script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment