0

我在fancybox 中使用simple_form。

如果我不使用fancybox,我可以使用(validation true)进行谷歌的位置自动完成和simple_form 验证。

这东西在fancybox中不起作用。

使用 fancybox2-rails (0.2.4)

  <%= simple_form_for @hotlist, :validate => true, :html => {:multipart => true, name: 'hotlist_resume'} do |f| %>
    <%= f.input :name, placeholder: 'Full Name' %>
    <%= f.input :email, as: :email, placeholder: 'Enter valid email address' %>
    <%= f.input :phone, input_html: {type: 'text'}, required: false %>
    <%= f.input :current_location %>
<% end %>

没有花式框:

<%= link_to 'Create Hotlist Resume', new_hotlist_resume_path, class: 'btn btn-inverse', style: 'font-weight: normal;' %>

带花式盒

    <%= link_to 'Create Hotlist Resume', new_hotlist_resume_path, class: 'btn btn-inverse fancybox fancybox.ajax', style: 'font-weight: normal;' %>

模型验证

validates_presence_of :name, :current_location, :email, :phone
4

0 回答 0