Rails form @new_post


#1

So I'm on this step and I'm stuck.Probably over thinking.

In app/views/posts/index.html, create a Rails form with the fields of the @new_post object to post comments.

What will the form code be?


#2

I got it to work like this:

<%= form_for(@new_post) do |f| %>  
    <div class="field"> 
      <%= f.label :comment %>: 
      <%= f.text_field :comment %> 
    </div> 
    <div class="actions"> 
    <%= f.submit "Create" %> 
    </div> 
  <% end %>

threadly/app/views/posts/index.html.erb