Sha256: 159204532dbf6dfad3e9cd08934bab6e755d8445c09cb165f0c0b667dfcb938c

Contents?: true

Size: 979 Bytes

Versions: 12

Compression:

Stored size: 979 Bytes

Contents

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

- if @resource
  .row
    .col-xs-8
      %h1= @page_title
    .col-xs-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

12 entries across 12 versions & 1 rubygems

Version Path
effective_resources-0.7.11 app/views/application/show.html.haml
effective_resources-0.7.10 app/views/application/show.html.haml
effective_resources-0.7.9 app/views/application/show.html.haml
effective_resources-0.7.8 app/views/application/show.html.haml
effective_resources-0.7.7 app/views/application/show.html.haml
effective_resources-0.7.6 app/views/application/show.html.haml
effective_resources-0.7.5 app/views/application/show.html.haml
effective_resources-0.7.4 app/views/application/show.html.haml
effective_resources-0.7.3 app/views/application/show.html.haml
effective_resources-0.7.2 app/views/application/show.html.haml
effective_resources-0.7.1 app/views/application/show.html.haml
effective_resources-0.7.0 app/views/application/show.html.haml