On 10/25/07, Michael Koziarski <[EMAIL PROTECTED]> wrote:
>
>
> > In 2.0 we get the convenience of:
> >
> >   def create
> >     item = Item.create(params[:item])
> >     redirect_to item, :status=>:see_other
> >   end
> >
> > Regardless, I think there's a strong argument for adding a see_other
> > method.  As syntactic sugar, it will help developers who are not quite
> > aware of the difference between 302 and 303.
>
> I don't think that another method is justified just for this case.
> there are hundreds of other status codes out there, why don't they get
> their own methods?


1.  Common use case.
2.  Recommended pattern we should encourage.
3.  Avoid boilerplate code.

And that's true for a lot of other status codes, many of which already get
treatment in Rails.  That treatment depends on the context, for example,
mapping ActiveRecord exception to 4xx status code is more developer-friendly
than catching the exception yourself and calling a method.  For 303 it
happens to be calling a method.

Assaf

Changing the default behaviour of redirect_to also seems way too risky
> for the minority of clients (active resource) that can make use of the
> distinction.
>
> The current API works fine, and the single status argument isn't a
> huge barrier to overcome.
>
> --
> Cheers
>
> Koz
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to