vhochstein / active_scaffold

Rails 4 Version of activescaffold supporting jquery
MIT License
156 stars 34 forks source link

Per Request Configuration action.delete.link = false isn't working #63

Closed danil-z closed 13 years ago

danil-z commented 13 years ago

Hello again, if i define

active_scaffold :school do |conf|
  conf.delete.link = false
end

everything is good but if

before_filter :update_table_config

def update_table_config
 if current_user && current_user.role?(:operator)
  active_scaffold_config.list.columns.exclude :city
  active_scaffold_config.list.columns.exclude :region
  active_scaffold_config.list.columns.exclude :editors
  active_scaffold_config.delete.link = false
 end
end

all conditions work exept active_scaffold_config.delete.link = false

is it bug?

vhochstein commented 13 years ago

What do you want to achieve by setting delete.link = false??

danil-z commented 13 years ago

i would like to give rights to delete certain records depends user role... depends current_user...

danil-z commented 13 years ago

and hide this link for others role i made it with autorized_for_delete but link still visible(inactive)

vhochstein commented 13 years ago

Please use ignore_method for this task: http://vhochstein.wordpress.com/2010/09/30/actionlink-response-and-ignore/

vhochstein commented 13 years ago

Will close this issue. In case of any further question just reply.

vhochstein commented 13 years ago

Next try to close