On Martes, 18 de Agosto de 2009 07:06:22 Nick Rogers escribió:
> I'm having an issue with a custom action_link that points to an action
> of a controller that is not my scaffold's controller. Its a table link
> that should be inline. In most browsers the result is inserted fine,
> but there is no surrounding divs that add the close button. In Safari
> 4 the javascript in active_scaffold.js throws an exception and nothing
> is inserted (the action method is run though).
>
> I was able to replicate this with a pretty simple test app. Heres what
> the controllers looks like.
>
> class Admin::BarsController < ApplicationController
> active_scaffold :bar do |config|
>       # this link works just fine
>       config.action_links.add 'bars',
>
>         :action => 'bars_link',
>         :type => :table, :label => 'Bars', :crud_type => :read,
>         :inline => true, :position => :top
>
>       # this link has no surrounding style and close button under
> Firefox. does nothing in IE.
>       config.action_links.add 'another',
>
>         :controller => '/another',
>         :action => 'another_link',
>         :type => :table, :label => 'Another', :crud_type => :read,
>         :inline => true, :position => :top
>
> end
>
> def bars_link
> render :text => 'bars'
> end
>
> class AnotherController < ActionController::Base
>     def another_link
>         render :text => 'another'
>     end
> end
>
>
> The problematic javascript under Safari 4 seems to be
> active_scaffold.js line 421, where this.adapter is null.
>
> I'm not sure if this is even supposed to work, but I have no issues
> with table action_links to other controllers that are not inline and
> popup, so I would think inline should work too?

Inline action links add a adapter parameter (the partial which renders the div 
with the close link). In lib/extensions/action_controller_rendering.rb you can 
look at the code which process that param to insert the view in the adapter, 
but only is processed if the controller uses active scaffold. If your 
controller doesn't use active scaffold, is not supposed to work, in other case 
it's a bug.

>
>
> 
-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]


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

Reply via email to