I need a help to solve problem with ActiveScaffold,
Imagine that you have a list of companies, each company has a list of
products. If Iâ€™m administrator of some company and I want to edit my
products I also can see(not edit, editing/deleting is possible to
disable) other companies products.
I need to use activescaffold for displaying/editing only data that
connected to company that loggined by current user(of course product
model has a company_id, by I donâ€™t know how to filter this data).
Thank you for any help and advices
Have a nice day!
You can use the conditions_for_collection in your controller .
must be after config block to work
if ! (current_user.is_admin or current_user.is_hr)
[“staff = ?”, current_user.login]
On Aug 28, 5:39 am, “Igor K.” [email protected]