1) Как создавать формы, используя простую форму и twitter-bootstrap-rails, чтобы они показывали крутые ошибки проверки в стиле начальной загрузки?
2) Как построить формы в twitter-bootstrap-rails, чтобы они показывали крутые ошибки валидации в стиле бутстрапа?
3) Я попытался построить форму с помощью simple_form. Но проверка не показывает никаких сообщений об ошибках. Я пытаюсь добавить проверку модели пользователя и формы, созданной Devise
Технологии: Rails 3.2.7.rc1, 1.9.2, twitter-ootstrap-rails 2.1.1, простая форма 2.0.2
код:
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:class => 'form-vertical' }) do |f| %>
<%= f.error_notification %>
<%= f.input :fname, :placeholder=>"First name", :input_html => { :class => "enroll_input span4"} %>
<%= f.input :lname, :placeholder=>"Last name", :input_html => { :class => "enroll_input span4"} %>
<%= f.input :email,:placeholder=>"Email",:input_html => { :class => "enroll_input span4"} %>
<%= f.input :password, :placeholder=>"Password",:input_html => { :class => "enroll_input span4"} %>
<div class="enroll_button"> <%= f.submit " Enroll ", :class=>"btn btn-primary pull-right btn-large" %></div>
<% end %>
I am not sure though if this not working or jquery
is not working.
bootstrap
в качестве оболочки по умолчанию для этой формы. См.config.default_wrapper = :bootstrap
вconfig/initializers/simple_form.rb
. Чтобы сгенерировать конфигурацию simple_form с оболочкой начальной загрузки, используйте эту команду:rails generate simple_form:install --bootstrap
- person melekes   schedule 26.07.2012