I've been reading and watching videos on nested forms, but I haven't had any luck getting things working. (...and I know this just has to be incredibly easy...)
I have this view 'views/comments/new':
<% form_for([@job, @comment]) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :body %><br />
<%= f.text_area :body %>
</p>
<p>
<%= f.submit "Create" %>
</p>
<% end %>
...and I would like to move this form/text box to the 'jobs/show' view.
my job model: job.rb
belongs_to :user
has_many :comments, :dependent => :destroy
has_many :assets
accepts_nested_attributes_for :assets
accepts_nested_attributes_for :comments
What I would like to do is have the form to add new comments at the bottom of the this job "show" page. Instead of going to "/jobs/15/comments/new", I would like to have the "new comment" form in the jobs show view.
How could I do this?
Cheers.