After digging the AS code I have this that works:

redirect_to({:action=>'index',
                   :association => 'images',
                   :parent_scaffold => "admin_#{img.owner_type.downcase}",
                   :assoc_id => img.owner_id,
                   :"#{img.owner_type.downcase}_id" => img.owner_id,
                   :extra_param => "show_back_link:#{img.owner_type}"})

Is there any other more elegant way to do it?

On Friday, November 23, 2012 10:05:42 PM UTC+1, HernĂ¡n Astudillo wrote:
>
> something like this? (i'm guessing your models and controllers)
>
> :controller => 'images', :params => {:parent_scaffold => :admin_sale, 
> :owner_id => img.owner_id, :association => 'images'}
>
>
>
> On Fri, Nov 23, 2012 at 2:07 PM, Mihai <[email protected] 
> <javascript:>>wrote:
>
>> Hi there, 
>>
>> We have upgrade from an old version of ActiveScaffold to the newest one 
>> that works with Rails 3.2.
>> And I'm unable to find a solution to how to replace the redirects that 
>> use the old nested action that is not existing anymore.
>>
>> For example we have redirects like below that are used to redirect to an 
>> associations list of the current model.
>>
>> redirect_to :action=>'nested',:id=>@record.id,:associations=>'images'
>> or
>> redirect_to :controller=>"admin_sale, :action=>'nested',
>>           
>> :id=>img.owner_id,:associations=>'images',:extra_param=>"show_back_link:#{img.owner_type}"
>>
>> Does someone knows how must be rewritten these redirects with the new 
>> ActiveScaffold?
>>
>> thanks,
>> mihai
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "ActiveScaffold : Ruby on Rails plugin" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/activescaffold/-/71CPX5Qk0IsJ.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> For more options, visit this group at 
>> http://groups.google.com/group/activescaffold?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/activescaffold/-/v3hk2JBFfNMJ.
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/activescaffold?hl=en.

Reply via email to