Override default redirects

0 views
Skip to first unread message

jamieorc

unread,
Jul 10, 2009, 8:45:28 PM7/10/09
to resources_controller
I don't want my redirects from create and update to go to show. How do
I tell resources_controller to redirect me to another view (in this
case, 'edit')?

Thanks,

Jamie

Chris Hapgood

unread,
Jul 10, 2009, 10:06:31 PM7/10/09
to resources_...@googlegroups.com
Jamie,
You need to override the default actions -a pretty common practice.

resources_controller_for :attachments, :actions
=> ::Hapgood::ParentAuthorizedActions

I've never thought this feature belongs in RC because it seems
orthogonal to RC's intent. But it's easy enough to circumvent
entirely (:actions => false, IIRC) or to replace the default actions.

-Chris
Chris Hapgood
cc...@hapgoods.com




Ian White

unread,
Jul 11, 2009, 2:43:49 AM7/11/09
to resources_...@googlegroups.com
Hi,

On 11 Jul 2009, at 03:06, Chris Hapgood wrote:
> You need to override the default actions -a pretty common practice.
Yep, or just rewrite that action in the controller if it's a one off
case.

You could also check out response_for on github, which is aimed at
letting you override just the response of an action (which is what you
want to do in this case).

Cheers,
Ian


>
> Jamie,

Chris Hapgood

unread,
Jul 11, 2009, 9:41:25 AM7/11/09
to resources_...@googlegroups.com
Doh!

On 11 Jul 2009, at 2:43, Ian White wrote:

> Yep, or just rewrite that action in the controller if it's a one off
> case.

Chris Hapgood
cc...@hapgoods.com


Reply all
Reply to author
Forward
0 new messages