On Martes, 10 de Noviembre de 2009 18:38:21 Aaron Turner escribió:
> On Tue, Nov 10, 2009 at 1:17 AM, Sergio Cambra .:: entreCables S.L.
>
> ::. <[email protected]> wrote:
> >
> > I don't know Lockdown, you can try to debug using a debugger. Add a
> > debugger line in
> > vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb, after
> > do_list call in list method (after line 28), and check the content of
> > records.
>
> Fair enough.  Anyways, I have a working theory what is going on:
>
> Basically, when I'm not logged in, I don't have edit permissions to
> anything.  And even though I have told AS to link to nested lists for
> the column data using the following code:
>
> module WinesHelper
>   def varietal_column(record)
>     link_to(h(record.varietal.name), :action => :nested, :controller
> => 'varietals',
>
>             :id => record.varietal.id,
>             :_method => 'get', :associations => 'wines')
>
>   end
>
>   def appellation_column(record)
>     link_to(h(record.appellation.name), :action => :nested,
>
> :controller => 'appellations',
> :
>             :id => record.appellation.id,
>            :
>            :_method => 'get', :associations => 'wines')
>
>   end
>
>   def producer_column(record)
>     link_to(h(record.producer.name), :action => :nested, :controller
> => 'producers',
>
>             :id => record.producer.id,
>            :
>            :_method => 'get', :associations => 'wines')
>
>   end
> end
>
> something about AS is suppressing the column data because it still
> thinks it is supposed to generate the default edit links which are
> forbidden for non-logged in users.
>
> Is this a reasonable theory?  I haven't been able to pin point the
> offending bit of code yet.  Is there a better way to go about what I'm
> trying to accomplish that won't have this side effect?

ActiveScaffold check permissions for links added automatically or with set_link 
in the controller. When you use a field override output is not altered.

You can try to debug overriding list view in your controller with this:
<p>Records count: <%= @records.size %></p>
<%= render :super %>

>
> Thanks!

-- 
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].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=.


Reply via email to