On Jun 14, 2011, at 10:02 AM, Sta Canovist wrote:
2011/6/14 Walter Davis <wa...@wdstudio.com>
Cue Mythbusters theme music: "Well, there's your problem right
there..."
Ok, running bundle exec rake routes solves the problem.
Now I can see all the routes. There are a lot.
Those related to my problem are:
portal_edit
POST
/admin/accounts/:account_id/portals/:portal_id/edit(.:format)
{:action=>"edit", :controller=>"admin/portals"}
This looks like the path you want to post your form results to, but if
this is a POST, you should be hitting :action => 'update' rather than
'edit'.
To load the form that you will fill with new data for your update, you
would have a matching route that used GET, and hit :action => 'edit'.
If you don't want to use REST conventions (GET to load the edit, form
POST to accept the update) then you need to get out of that end of the
pool and use older-style non-RESTful routes, which you can spot by
their dangling ids:
/admin/accounts/2/portals/edit/4
Have a look at the very bottom of your routes file for comments about
configuring those, I'm not sure what the syntax would be in Rails 3,
haven't done those since Rails 2.
Walter
edit_portal
GET
/portals/:id/edit(.:format)
{:action=>"edit", :controller=>"portals"}
edit_admin_account_portal
GET
/admin/accounts/:account_id/portals/:id/edit(.:format)
{:action=>"edit", :controller=>"admin/portals"}
edit_admin_account
GET
/admin/accounts/:id/edit(.:format)
{:action=>"edit", :controller=>"admin/accounts"}
Does this tell you somthing?
--
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-
t...@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
.
--
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.