jendiamond / railsgirls-signup

https://railsgirls-signup.herokuapp.com
3 stars 3 forks source link

Add simple form #19

Closed jendiamond closed 8 years ago

jendiamond commented 8 years ago

Pull request: https://github.com/jendiamond/railsgirls-signup/pull/33

Add to Gemfile gem 'simple_form', '~> 3.2', '>= 3.2.1' $ bundle $ rails generate simple_form:install --bootstrap

<%= simple_form_for @user do |f| %>
  <%= f.input :name, required: false %>
  <%= f.input :username %>
  <%= f.input :password %>
  <%= f.button :submit %>
<% end %>
<%= simple_form_for @user do |f| %>
  <%= f.input :user %>
  <%= f.input :age, collection: 18..60 %>
  <%= f.button :submit %>
<% end %>
jendiamond commented 8 years ago

This message appears after you run $ rails generate simple_form:install --bootstrap

Be sure to have a copy of the Bootstrap stylesheet available on your
  application, you can get it on http://getbootstrap.com/.

  Inside your views, use the 'simple_form_for' with one of the Bootstrap form
  classes, '.form-horizontal' or '.form-inline', as the following:

    = simple_form_for(@user, html: { class: 'form-horizontal' }) do |form|