I am trying to create an element in my form that uses a simple + bootstrap form. The idea is to let the user select a currency type from the drop-down list.
Customer_currency for choosing from USD-US Dollars, LRD - Liberian dollar among others.
I used the following in my form
However, it does not work, all I see is a dropdown (out of position) in my form with parameters, but without a label.
How to create a nice select element with a label using a simple form
<%= simple_form_for @customer, :html => { :class => 'form-horizontal' } do |f| %> <%= f.input :name %> <%= f.select :customer_currency, [['UGX- Uganda Shillings',1],['USD- US Dollars',2]] %> <%= f.input :payment_terms %> <%= f.input :billing_address %> <%= f.input :first_name %> <%= f.input :last_name %> <%= f.input :mobile %> <%= f.input :email %> <div class="form-actions"> <%= f.button :submit, :class => 'btn-primary' %> <%= link_to t('.cancel', :default => t("helpers.links.cancel")), customers_path, :class => 'btn' %> </div> <% end %>
source share