Module | Admin::PermissionsHelper
In: | app/helpers/admin/permissions_helper.rb

### Methods

show_or_edit_tag_for

### Public Instance methods

show_or_edit_tag_for(perm, mode="show")

[Source]

        # File app/helpers/admin/permissions_helper.rb, line 3
     3:   def show_or_edit_tag_for(perm, mode="show")
     4:     if mode.eql?("show")
     5:       return @user.permissions_for_form_array.include?(perm) ? image_tag("publish.gif") : image_tag("erase.gif")
     6:     elsif mode.eql?("edit")
     7:       existing_perm = @user.permissions_for_form.detect {|p| "perm[#{p.module}][#{p.action}]".eql?(perm)}
     8:       if existing_perm
     9:         return check_box_tag("#{perm}", 1, true, :disabled => existing_perm.not_editable)
    10:       else
    11:         return check_box_tag("#{perm}", 1, false, :disabled => false)
    12:       end
    13:     end
    14:   end

[Validate]