0

ファンシーボックス内で simple_form を使用しています。

ファンシーボックスを使用していない場合は、(validation true) を使用して、Google の場所のオートコンプリートと simple_form の検証を行うことができます。

これはファンシーボックス内では機能しません。

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