I’m starting to use simple_form for a rails application, and while converting some of my forms, I came across one that has two models that it is working with, sort of an embedded form. Is this possible with simple_form?
<% simple_form_for :topic, :url => forum_topics_path do |t| %>
<%= t.input :name, :label => 'Topic' %></p>
<p>First Post:<br/></p>
Title: <%= text_field :post, :title %> <--- this is where i start having problems
Body: <%= text_area :post, :body %>
<%= t.submit 'Save' %>
Thanks
Use
simple_fields_for:Notes
Note the
=symbol in<%= simple_form_for ...and<%= simple_fields_for(required in Rails 3.x)Removed “Title:” and “Body:” text. Use the label generated for the inputs and style their location with CSS as needed.
Added example of using
input_html