Sha256: 869113306340b0d94416d9fff423555fc08d03d1d0281b54f5c35fb74f31da14

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

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

- if @resource
  .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

20 entries across 20 versions & 1 rubygems

Version Path
effective_resources-0.6.9 app/views/application/edit.html.haml
effective_resources-0.6.8 app/views/application/edit.html.haml
effective_resources-0.6.7 app/views/application/edit.html.haml
effective_resources-0.6.6 app/views/application/edit.html.haml
effective_resources-0.6.5 app/views/application/edit.html.haml
effective_resources-0.6.4 app/views/application/edit.html.haml
effective_resources-0.6.3 app/views/application/edit.html.haml
effective_resources-0.6.2 app/views/application/edit.html.haml
effective_resources-0.6.1 app/views/application/edit.html.haml
effective_resources-0.6.0 app/views/application/edit.html.haml
effective_resources-0.5.1 app/views/application/edit.html.haml
effective_resources-0.5.0 app/views/application/edit.html.haml
effective_resources-0.4.10 app/views/application/edit.html.haml
effective_resources-0.4.9 app/views/application/edit.html.haml
effective_resources-0.4.8 app/views/application/edit.html.haml
effective_resources-0.4.7 app/views/application/edit.html.haml
effective_resources-0.4.6 app/views/application/edit.html.haml
effective_resources-0.4.5 app/views/application/edit.html.haml
effective_resources-0.4.4 app/views/application/edit.html.haml
effective_resources-0.4.3 app/views/application/edit.html.haml