On Apr 20, 11:44 am, Neil Bye <[email protected]> wrote:
> > have you tried form_for [@comment, :subcomment] ?
> > This will make sure that the http method etc is right for creating a
> > new comment
>
> > Fred
>
> I now have:
>
> <%= form_for [@comment, :subcomment], :remote => true, :url =>
> comment_subcomments_path(@comment) do |form| %>
>            <%= form.text_field :body %>
>  <% end %>
>
> But sill get the No route matches {:controller=>"subcomments"}

Sorry, that was wrong - it should be form_for [@comment,
Subcomment.new], you don't need the :url option
You should also make sure that @comment is set to the comment to which
subcomments should be added to

Fred

>
> Confused
>
> Neil
>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to