effective_resources 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b065e313e4557d61719a9164d5ac32226a8070e4
4
- data.tar.gz: 2e451c636d5644ff487a5df44c546053675eaed6
3
+ metadata.gz: 35cbb54f201aa73759a5b30e40a64872edd06a90
4
+ data.tar.gz: 155d1eb21e118942bf426030951ad9c0711ec264
5
5
  SHA512:
6
- metadata.gz: d428a2f4135014eb14d5bd92734e327cb1befff5acbc0e2c7b5c9d9a58c07e34aeca29531f8228e1614ac046bccd30d9c43665e3ec594bdead3018cb7b5febc5
7
- data.tar.gz: c072a4f0c130c92e5b7c2ac57a299b6e61c092c8b3d8d17a59a51d8af49ffb1292b2006aae0a38a2720eee2a04679b088141d108d3fda37ba0bff45f7f60652f
6
+ metadata.gz: f13b0ce467ebebdab7673f67c367118335d1894494b3c558cf9ae2486f7908c3d30c54dc380f2475cf3533212668fe27e16aee140c170ab57b8eaeec8e694d06
7
+ data.tar.gz: ec7a4f34b62a61c0c3bfa800dd71e12315b03fd970378dbc2ed79d4af23ee0cb2e7bc803adaada3f5e4267af86f84feabb33c2a0b1a9ee13e0f3bc1996dafa24
@@ -6,11 +6,6 @@
6
6
  .col-8
7
7
  %h1= @page_title
8
8
  .col-4.text-right
9
- - resource.member_post_actions.each do |action|
10
- - if EffectiveResources.authorized?(controller, action, @resource) && (path = resource.action_path(action, @resource)).present?
11
- = link_to action.to_s.titleize, path, class: 'btn btn-sm btn-primary', data: { confirm: "Really #{action} #{@resource}?", method: :post }
12
-
13
- - if EffectiveResources.authorized?(controller, :destroy, @resource) && (path = resource.action_path(:destroy, @resource)).present?
14
- = link_to 'Delete', path, class: 'btn btn-sm btn-danger', data: { confirm: "Really delete #{@resource}?", method: :delete }
9
+ = render_resource_actions(resource, @resource, edit: false)
15
10
 
16
11
  = render_resource_form(resource)
@@ -4,8 +4,7 @@
4
4
  .col-8
5
5
  %h1= @page_title
6
6
  .col-4.text-right
7
- - if EffectiveResources.authorized?(controller, :new, resource.klass) && (path = resource.action_path(:new)).present?
8
- = link_to "New #{resource.human_name.titleize}", path, class: 'btn btn-primary'
7
+ = render_resource_actions(resource)
9
8
 
10
9
  - if @datatable
11
10
  = render_datatable(@datatable)
@@ -6,12 +6,7 @@
6
6
  .col-8
7
7
  %h1= @page_title
8
8
  .col-4.text-right
9
- - resource.member_post_actions.each do |action|
10
- - if EffectiveResources.authorized?(controller, action, @resource) && (path = resource.action_path(action, @resource)).present?
11
- = link_to action.to_s.titleize, path, class: 'btn btn-sm btn-primary', data: { confirm: "Really #{action} #{@resource}?", method: :post }
12
-
13
- - if EffectiveResources.authorized?(controller, :destroy, @resource) && (path = resource.action_path(:destroy, @resource)).present?
14
- = link_to 'Delete', path, class: 'btn btn-sm btn-danger', data: { confirm: "Really delete #{@resource}?", method: :delete }
9
+ = render_resource_actions(resource, @resource, show: false)
15
10
 
16
11
  = render @resource
17
12
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.9.0'.freeze
2
+ VERSION = '0.9.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect