In your controller you can define a conditions_for_collection method
to filter the list. For example I use ...

    def conditions_for_collection
      ['sales.division_id = ' + current_user.division_id.to_s]
    end

On Oct 14, 11:31 am, snowdrop <[email protected]> wrote:
> Hi,
>
> I want to filter listed rows. HEre my controller
>
> class ProgramsController < ApplicationController
>   layout 'admin'
>   before_filter :authorize
>   active_scaffold :program do |config|
>   end
> end
>
> I want only list programs owned by the current logged in user
>
> class User
> has_many: programs
> end
>
> I want to list only @current_user.programs where @current_user is of
> type User.
>
> How can I do this?
--~--~---------~--~----~------------~-------~--~----~
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