ruby on rails - Bootstrap datepicker default value simple_form_for -


i using bootstrap date picker enable selection of dates in form using simple_form_for. example

  <%= f.input :payment_date, as: :string, input_html: { class: "datepicker" } %> 

my date picker uses format of dd-mm-yyyy

i set today's date default value in form using simple_form_for, ideas on how can that?

<%= f.input :payment_date, as: :string, input_html: { class: "datepicker", value: time.now.strftime('%d-%m-%y') } %>    

another format is: (working active admin gem)

f.input :date, as: :date_picker, :input_html => { :value => date.today} 

Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -