I would like to be able to change the link icon in the list view based on one of the attribute of that record.
register_instance_option :member do
17 register_instance_option :link_icon do
20 register_instance_option :controller do
21 Proc.new do
22 # Get all selected rows
23 @objects = list_entries(@model_config, :destroy)
25 # Update field published to true
26 @objects.each do |object|
29 redirect_to back_or_index
I would like to update my link_icon to 'icon-ok' when the action is performed
Better late than never but you could do something like:
register_instance_option :link_icon do
Comment.where(commentable_type: bindings[:abstract_model].model_name, commentable_id: bindings[:object].id).count > 0 ? 'icon-user orange' : 'icon-user'
although it can get expensive.