Hey i took your advice and took a closer look at the code scaffold
generates for my NEW & EDIT views and it seems that form_for takes the
same argument for edit and new which is the object itself, in this
case @category.

I used the form_for and it worked.  can you explain again why it
works?  that would be really helpful.

thanks,

On Sep 13, 3:28 am, Darrik Mazey <[EMAIL PROTECTED]> wrote:
> chris wrote:
> > i'm having a routing problem with my UPDATE action.  I've pasted my
> > CATEGORIES controller and view below.  I ran scaffold for categories
> > and i consolidated everything into a single view so that I could show
> > list, create new, edit, destroy all from a single page.  my create,
> > destroy actions work and my index view works as expected.  my UPDATE
> > action however returns the following:
>
> > Processing CategoriesController#16 (for 127.0.0.1 at 2008-09-08
> > 13:08:22) [POST]
> >   Session ID: c05797629988686fd3951de29fca7e24
> >   Parameters: {"commit"=>"Update",
> > "category"=>{"name"=>"Entertainment", "description"=>"Latest gossip
> > about your favourite stars12", "short_name"=>"entertainment"},
> > "authenticity_token"=>"b6a61d7dc0890d83a923366cd5c93e672b16f62e",
> > "action"=>"16", "controller"=>"categories"}
>
> Chris,
> update under REST should be a PUT request, and if you compare html
> resultant from the scaffolding code for new.html.erb and edit.html.erb,
> you'll find that edit contains the following after the <form> tag:
>
> <input name="_method" type="hidden" value="put" />
>
> I suspect if you add that in somehow programmatically, your problems
> will be solved. ;)
>
> Cheers,
> Darrik
--~--~---------~--~----~------------~-------~--~----~
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