-
Notifications
You must be signed in to change notification settings - Fork 8
SimpleForm
JP Barbosa edited this page Jul 23, 2015
·
2 revisions
echo "gem 'simple_form'" >> Gemfile
bundle install
rails s
nano app/views/authors/_form.html.erb
<%= simple_form_for(@author) do |f| %>
<%= f.input :name %>
<%= f.input :email %>
<%= f.button :submit %>
<% end %>
nano app/views/articles/_form.html.erb
<%= simple_form_for(@article) do |f| %>
<%= f.input :title %>
<%= f.input :content %>
<%= f.association :author %>
<%= f.button :submit %>
<% end %>
open http://localhost:3000/articles/new
open http://localhost:3000/authors/new
git add .
git commit -m "Add SimpleForm"