Thank you guys.

Bill, you helped me a lot. That was exactly what I needed to hear.

Well, I came here once again just to share this article that I found that
answers my questions too. In case someone have the same question.

http://dathompson.blogspot.com/2008/07/restful-rails-passing-url-parameters.html

<http://dathompson.blogspot.com/2008/07/restful-rails-passing-url-parameters.html>
Regards,
Marco Antonio

On Sat, Jul 17, 2010 at 2:14 PM, Bill Walton <[email protected]> wrote:

> Hi Marco,
>
> On Sat, Jul 17, 2010 at 5:29 AM, Marco Antonio Filho
> <[email protected]> wrote:
> > Hi Guys,
> > I am developing a blog system with Rails and I have a question about the
> > following matter:
> > My client wants me to create an approve and disapprove action for the
> > comments.
> > So, I did create two actions in the rails comment controller called by a
> put
> > method, since the only thing they do is change the approved collumn at
> the
> > database. I am still not familiar with REST, so I decided to ask what you
> > would do in a situation like this.
> > Another way I was thinking is create an action update and there I would
> > handle if I get a params[:approve] or a params[:disapprove].
>
> I think, in the end, you're making a choice is between:
>
> /blog/23/comments/4/approve
>
> and
>
> /blog/23/comments/4?approve
>
> From a REST perspective, the latter is probably slightly more
> preferred.  Fielding's dissertation does not provide a prescription at
> this level of detail, focusing instead on the need for unique resource
> identifiers.  In the sense that the resource itself is more clearly
> identified in your proposal, I would venture an opinion that it is
> more RESTful than your client's proposal.  But I wouldn't get wrapped
> around the axle with a client on that point.
>
> From a code maintenance perspective,however,  the latter is much more
> preferable in that it requires only one method (update) instead of two
> (approve/disapprove).   Additionally, the Rails routing engine
> supports / generates the CRUD methods by default, whereas you will
> need to do extra work to support your client's request.  That reduced
> complexity translates to $$$ which, in my experience, typically
> engages clients instantly.
>
> HTH,
> Bill
>
> --
> 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]<rubyonrails-talk%[email protected]>
> .
> 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 [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.

Reply via email to