Sha256: 0cbcbd43a6898b3047438ed72a25c122bbbd109df03a81e7278c83f14dd7929b

Contents?: true

Size: 995 Bytes

Versions: 5

Compression:

Stored size: 995 Bytes

Contents

- custom_action_with_modals = @model.available_actions.select{ |act| act if act.display_type == :modal }
- destroy_action = available_actions(@model, 'destroy')
- if @associated_model
  - custom_action_with_modals += @associated_model.available_actions.select{ |act| act if act.display_type == :modal }

- if @current_action&.name == 'index'
  - @ar_object.data.each do |ar_object|
    - custom_action_with_modals.each do |custom_action|
      = render partial: '/layouts/custom_action_modal', locals: { custom_action: custom_action, ar_object: ar_object }
    - if destroy_action
      = render partial: '/layouts/destroy_action_modal', locals: { ar_object: ar_object }
- elsif @current_action&.name == 'show'
  - custom_action_with_modals.each do |custom_action|
    = render partial: '/layouts/custom_action_modal', locals: { custom_action: custom_action, ar_object: @ar_object }
  - if destroy_action
      = render partial: '/layouts/destroy_action_modal', locals: { ar_object: @ar_object }

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cm-admin-1.2.4 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.2.3 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.2.2 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.2.1 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.2.0 app/views/layouts/_custom_action_modals.html.slim