简体   繁体   中英

Rails Simple Form DEPRECATION WARNING

Simple Form 2.0.1 client_side_validations 3.1.4

Problem:

"error_class":"DEPRECATION WARNING: [SIMPLE_FORM] SimpleForm.error_class is deprecated and has no effect. (called from error_class at (eval):1)",
"error_tag":"DEPRECATION WARNING: [SIMPLE_FORM] SimpleForm.error_tag is deprecated and has no effect. (called from error_tag at (eval):1)",
"wrapper_error_class":"DEPRECATION WARNING: [SIMPLE_FORM] SimpleForm.wrapper_error_class is deprecated and has no effect. (called from wrapper_error_class at (eval):1)",
"wrapper_tag":"DEPRECATION WARNING: [SIMPLE_FORM] SimpleForm.wrapper_tag is deprecated and has no effect. (called from wrapper_tag at (eval):1)"

How to solve?

My view:

<%= simple_form_for @book_item, :validate => true do |f| %>
  <%= f.input :name %>
  <%= f.input :description %>
  <%= f.button :submit %>
  <%= link_to t('.cancel', :default => t("helpers.links.cancel")), book_items_path, :class => 'btn' %>
<% end %>

我假设您正在使用client_side_validations-simple_form gem进行SimpleForm集成,但是它现在不适用于SimpleForm 2- https://github.com/dockyard/client_side_validations-simple_form/issues/2

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM