0
votes

This is my form for now in my new_html_erb.

We are doing a promotion for the next two weeks
<%= simple_form_for @subscription, :html => { :class => 'form-horizontal'} do |f| %>
    <%= f.input :manual_expiry_date %>
    <%= f.association :user %>
    <%= f.button :submit, :class => 'btn btn-primary'%>
<% end %>

I have used twitter bootstrap on and off. The form that I am working on for a rails application is using bootstrap.

How do I add bootstrap datepicker to manual_expiry_date ? How do I center my simple_form_for?

I have tried putting the form in a container, then a row, then adding form control all in divs. There was no marked change. I have tried adding it as a class to simple_form but still the same.

Thank you for the help.

1

1 Answers

1
votes

Twitter Bootstrap dont have in his core a date-picker, buy you can use "DatePicker For Bootstrap" www.eyecon.ro/bootstrap-datepicker/

You need to specify the class of the object

<%= f.input :manual_expiry_date, input_html: { class: 'date_picker' } %>

and then

$('.date_picker').datepicker()