Hi!

I have a list where you can add items, where Items are nested inside Lists.

So, now I want to render my form partial to create new items in the Lists 
show view. I want to be able to add items to the list without leaving the 
list through a link.

My _form partial looks like this
<%= semantic_form_for [@item.list, @item] do |f| %> 
  <%= f.inputs "Item" do %> 
    <%= f.input :title %> 
    <%= f.input :amount %> 
    <%= f.input :unit %> 
  <% end %> 
   <%= f.buttons %> 
<% end %>

I have tried to just do  <%= render 'items/form' %> which doesn't work. I 
guess I have to send populate the @item variable when rendering the 
template.
Also, I'm not sure how the form will know this is a new action and not an 
edit.
   

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/tOgF6xyLghcJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to