ruby - Bootstrap time picker rails without gem -


i trying

i have starts_at:datetime field , want fill form using bootstrap-datetimepicker

here form:

= simple_form_for @event |f|     = f.input :title     = f.input :starts_at     = f.button :submit 

my main.js file:

 $(document).ready(function(){         $(".form_datetime").datetimepicker({format: 'yyyy-mm-dd'});  }); 

how can give starts_at datettimepicker input style?

you'll have call .datetimepicker() method on input element want give datepicker. simple_form should generate element id "event_starts_at", try:

$("#event_starts_at").datetimepicker({format: 'yyyy-mm-dd'});

if doesn't work or if want give input element different id, can override passing option:

= f.input :starts_at, id: "event_starts_at"


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -