Hi all,
I'm getting an error in my rails 3 app when trying to update a user's
profile:
Started POST "/users/1328-mturner" for 127.0.0.1 at 2010-06-11
13:02:09
ActionController::RoutingError (No route matches "/users/1328-
mturner"):
I'm not sure why this is happening as I'm using a standard controller
as generated by rails:
def update
@user = User.find(params[:id])
respond_to do |format|
if @user.update_attributes(params[:user])
format.html { redirect_to(@user, :notice => 'User information
was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @user.errors, :status
=> :unprocessable_entity }
end
end
end
I wonder if it is something to do with the fact it's attempting to
POST when it should be PUTting? Why would it be doing this?
Here's what rake routes says about users:
GET /users(.:format)
{:controller=>"users", :action=>"index"}
users POST /users(.:format)
{:controller=>"users", :action=>"create"}
new_user GET /users/new(.:format)
{:controller=>"users", :action=>"new"}
GET /users/:id(.:format)
{:controller=>"users", :action=>"show"}
PUT /users/:id(.:format)
{:controller=>"users", :action=>"update"}
user DELETE /users/:id(.:format)
{:controller=>"users", :action=>"destroy"}
edit_user GET /users/:id/edit(.:format)
{:controller=>"users", :action=>"edit"}
Any help would be much appreciated!
Thanks,
Mark
--
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.