Sha256: 449f9be291cf186db6fcffd0b3cd13abdf6d1bb01938740d294b519e519c5cc9
Contents?: true
Size: 1.29 KB
Versions: 13
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true module Tramway::Admin::ActionsHelper def destroy_is_available?(association_object, _main_object) ::Tramway::Admin.action_is_available?( association_object, project: (@application_engine || @application.name), model_name: association_object.model.class.name, role: current_admin.role, action: :destroy ) end def update_is_available?(association_object, _main_object) ::Tramway::Admin.action_is_available?( association_object, project: (@application_engine || @application.name), model_name: association_object.model.class.name, role: current_admin.role, action: :update ) end def create_is_available?(association_class) ::Tramway::Admin.action_is_available?( nil, project: (@application_engine || @application.name), model_name: association_class, role: current_admin.role, action: :create ) end # delete_button is in smart-buttons gem def edit_button(url:, button_options:) link_to(url, **button_options) { yield } end def habtm_destroy_is_available?(association_object, main_object) ::Tramway::Admin.forms&.include?("#{main_object.model.class.to_s.underscore.pluralize}/remove_#{association_object.model.class.to_s.underscore}") end end
Version data entries
13 entries across 13 versions & 1 rubygems