Sha256: 0296013217b9ef24e21442080003b037d4a63bbdc164fdc174b1e41d8674187e

Contents?: true

Size: 973 Bytes

Versions: 30

Compression:

Stored size: 973 Bytes

Contents

- resource = (@_effective_resource || Effective::Resource.new(controller_path))
- @resource = instance_variable_get('@' + resource.name) if resource.name

- if @resource
  .row
    .col-8
      %h1= @page_title
    .col-4.text-right
      - resource.member_post_actions.each do |action|
        - if EffectiveResources.authorized?(controller, action, @resource) && (path = resource.action_path(action, @resource)).present?
          = link_to action.to_s.titleize, path, class: 'btn btn-sm btn-primary', data: { confirm: "Really #{action} #{@resource}?", method: :post }

      - if EffectiveResources.authorized?(controller, :destroy, @resource) && (path = resource.action_path(:destroy, @resource)).present?
        = link_to 'Delete', path, class: 'btn btn-sm btn-danger', data: { confirm: "Really delete #{@resource}?", method: :delete }

  = render @resource

.form-actions
  = link_to 'Continue', (resource.action_path(:index) || root_path), class: 'btn btn-primary'

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
effective_resources-0.9.0 app/views/application/show.html.haml
effective_resources-0.8.26 app/views/application/show.html.haml
effective_resources-0.8.25 app/views/application/show.html.haml
effective_resources-0.8.24 app/views/application/show.html.haml
effective_resources-0.8.23 app/views/application/show.html.haml
effective_resources-0.8.22 app/views/application/show.html.haml
effective_resources-0.8.21 app/views/application/show.html.haml
effective_resources-0.8.20 app/views/application/show.html.haml
effective_resources-0.8.19 app/views/application/show.html.haml
effective_resources-0.8.18 app/views/application/show.html.haml
effective_resources-0.8.17 app/views/application/show.html.haml
effective_resources-0.8.16 app/views/application/show.html.haml
effective_resources-0.8.15 app/views/application/show.html.haml
effective_resources-0.8.14 app/views/application/show.html.haml
effective_resources-0.8.13 app/views/application/show.html.haml
effective_resources-0.8.12 app/views/application/show.html.haml
effective_resources-0.8.11 app/views/application/show.html.haml
effective_resources-0.8.10 app/views/application/show.html.haml
effective_resources-0.8.9 app/views/application/show.html.haml
effective_resources-0.8.8 app/views/application/show.html.haml