I am trying to display form fields based on CanCan with Rolify roles. Using the standard ActiveAdmin Form it works. using the active_association_form it does not.
My code:
f.input :sub_domain if current_admin_user.has_role? :super_admin
The error:
ActionView::Template::Error (undefined local variable or method `current_admin_user' for #ActiveAdmin::ResourceDSL:0xb4e8bc64):
1: <%= admin_form_for resource %>
2:
3: <%- if resource.persisted? && active_admin_config.form_associations.present? -%>
4: <%- active_admin_config.form_associations.each do |association| -%>
Hi,
first of all thanks for your great contribution.
I am trying to display form fields based on CanCan with Rolify roles. Using the standard ActiveAdmin Form it works. using the active_association_form it does not.
My code:
f.input :sub_domain if current_admin_user.has_role? :super_admin
The error:
ActionView::Template::Error (undefined local variable or method `current_admin_user' for #ActiveAdmin::ResourceDSL:0xb4e8bc64): 1: <%= admin_form_for resource %> 2: 3: <%- if resource.persisted? && active_admin_config.form_associations.present? -%> 4: <%- active_admin_config.form_associations.each do |association| -%>
Any help would be appreciated.
Mario