I am using Formtastic and on a form I have:
<%= f.input :open_date, :as => :string, :input_html => {:class => 'datepicker'}, :start_date => Date.today, label: 'OPEN' %>
Then I validate the field with
validates :open_date, presence: true
If I submit the form with empty field it returns:
NoMethodError in Clients#create
Completed 500 Internal Server Error in 44ms (ActiveRecord: 5.7ms)
ActionView::Template::Error (undefined method `html_safe' for Formtastic::Util:Module
Did you mean? html_safe?):
6: <div class="row">
7:
8: <div class="col-sm-3">
9: <%= f.input :open_date, :as => :string, :input_html => {:class => 'datepicker'}, :start_date => Date.today, label: 'OPEN' %>
10: </div>
11:
12: <div class="col-sm-3">
I can't find any other way to call datepicker other than with
:input_html => {:class => 'datepicker'}
How can I fix the issue?
The problem is that I am using formtastic-bootstrap and the issue is already reported here too.
SO I guess I have no choice but removing the gem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.