>> >> <%= form_for :subcomment, :remote => true, :url => >> user_subcomments_path(@user) do |form| %> >> <%= form.text_field :body %> >> <p><%= submit_tag 'Comment' %></p> >> <% end %>
> comment_subcomments_path(@comment) (assuming @comment is what the user > wants to comment on) rather than user_subcomments_path(@user) with a > hidden field with the comment_id because the user creating an object is > usually obtainable via your login system (indeed in most cases you don't > want people to be able to create subcomments as other users just by > editing the URL the form posts to) > Ok I see your point but now I run into a routes problem which doesn't come up if I use user_subcomments_path(@user) When I use 'comment_subcomments_path(@comment)' I get 'No route matches {:controller=>"subcomments"}' Of course subcomments_controller exists This is from routes.rb resources :comments resources :subcomments resources :users resources :users do resources :comments end resources :comments do resources :subcomments end resources :users do resources :subcomments end -- Posted via http://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 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.