Sha256: 4485f732425ceb271a5b908b81d1de9eb0641d468eb7ac0041dde71abffe75bb

Contents?: true

Size: 969 Bytes

Versions: 3

Compression:

Stored size: 969 Bytes

Contents

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

.row
  .col-sm-6
    %h1= @page_title
  .col-sm-6
    %p.text-right
      - resource.member_post_actions.each do |action|
        - if EffectiveResources.authorized?(controller, action.to_sym, @resource)
          - if resource.action_post_path(action, check: true).present?
            = link_to action.titleize, send(resource.action_post_path(action), @resource), class: 'btn btn-primary',
              data: { confirm: "Really #{action} #{@resource}?", method: :post }

      - if EffectiveResources.authorized?(controller, :destroy, @resource)
        - if resource.destroy_path(check: true).present?
          = link_to 'Delete', send(resource.destroy_path, @resource), class: 'btn btn-danger',
            data: { confirm: "Really delete #{@resource}?", method: :delete }

= render 'form', resource.name.to_sym => @resource

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_resources-0.4.2 app/views/application/edit.html.haml
effective_resources-0.4.1 app/views/application/edit.html.haml
effective_resources-0.4.0 app/views/application/edit.html.haml