On 10 March 2010 12:44, Neil Bye <[email protected]> wrote:
> Colin Law wrote:
> .
>>
>> Do you mean you have two submits in one form?  You had not mentioned
>> that before, or I missed it.
>>
>> Colin
> There are three separate forms on three pages but they all refer to the
> stories_controller.rb . In the controller I a 'create' method  for the
> 'new' page
> The 'update' method  is for comments submitted on the 'show' page. Now I
> want an 'edit' page with a submit. What method can I use and how does
> the submit on the edit page know how to use it.
>
> Attachments:
> http://www.ruby-forum.com/attachment/4562/stories_controller.rb

You can specify the action in the form_for statement.

However, as I suggested earlier I would not use a separate action
anyway.  If you look at your code for update and add_comment you will
see there is a lot of similarity.  I would combine add_comment into
update and test params[:comment] to see whether to add the comment or
not.

Colin

-- 
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