I'd like to update an attribute in a model via an external POST request.
The external request is coming from an iOS iPhone application but I
imagine this is not relevant.
If I have a model App and it has the following attributes...
App
apple_identifier :integer
popularity :integer
I imagine I need an update reference in routes.rb like this..
PUT /apps/:id(.:format) {:action=>"update", :controller=>"apps"}
So what might the apps_controller update action look like to receive the
request and update the popularity count by one...I pretty much think I
can solve that myself really I just want to know my thinking it on the
right lines.
One thing, rake routes says PUT - is that the same as post?
What would the URL look like that I ask my iOS dev for, is it as simple
as what follows - any gotchas?
So what might the apps_controller update action look like to receive the
request and update the popularity count by one...I pretty much think I
can solve that myself really I just want to know my thinking it on the
right lines.
One thing, rake routes says PUT - is that the same as post?
Nope. PUT and POST are two different methods
What would the URL look like that I ask my iOS dev for, is it as simple
as what follows - any gotchas?