first of all it seems to me like you’re using the GET method for
updating the status. I think you better stick to the POST method for
your form. The GET method is good for querying your database through
request parameters. The POST method is better for creating or editing a
post.
So your URL should become with the GET method something like
/forums/status/4. In your controller you can put:
def status @thread = Thread.find(params[:thread][:id]) @thread.update_attributes = params[:thread]
if @thread.save
…
end
end
If in your form have update one attribute like the status
(params[:thread][:status]) then the update_attributes will only update
this attribute.
I’m just a newbie to Ruby and these are my suggestions…
Best regards,
Mark
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.