I am dealing with a very simple RESTful Rails application. There is a user model, and I need to update it. Rails codes like to do:
if @user.update_attributes(params[:user])
...
And from what I understand in REST, this url should work:
curl -d "first_name=tony&last_name=something2&v=1.0&_method=put" http://localhost:3000/users/1.xml
However, it is obvious that this will not work, because each URL parameter will parse the variable "params", not "params [: user]"
I have a hacker fix, but I wanted to know how people usually deal with this.
thank
source
share