generic_resources 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed552a3f0febc777983aea38b7cf711769bf4af6ef392efa5b833f98f19a8888
4
- data.tar.gz: 9f16feb1bb26233ab89334375f8a81d2ea929e2a69f241d35506abadff913209
3
+ metadata.gz: 7f88ed11f62a29483b17c6fd68a207df9f2eb4812079052360eddbea90b54052
4
+ data.tar.gz: 3afb8f0ff81d5be54152b59f10f7e6ca7d56c75a619d4940748e5a8b1fa1b6cc
5
5
  SHA512:
6
- metadata.gz: 752101b594364f1b58aa58c066886348ceb64448058bc16a859e9358206e921b10b5168904c97623163c6132b7002e914c3eae3d87a9462ff8d46646001558b0
7
- data.tar.gz: e4fd97ddf30f90b1eb5a2ff7069078f7ccb43cd1504f56f56148cbf89c86e50543cef120c0f324ab9b8642656ea752932f33573f5ebd8aefcfc5ee8bd735ca0f
6
+ metadata.gz: 5a49428c0e19c582f8241c3c68b2a586dc5dd2d3a2d89a2d87220481c38dcec5c139581b7d10e003f6005e01fa678f465b8b57e6ba9ad4a3848bcfbcf7511ae6
7
+ data.tar.gz: bb4ff85724bb8478ced9d60f91146d47128cc40e5b60786bdcd64d0fb4b21796efa896b687bb3d5b6f64bf1f5bc7beb802a0aa750accda2121281157b91559f5
@@ -62,10 +62,10 @@ class GenericResources::ResourcesController < GenericResources.configuration.par
62
62
  def assign_resource
63
63
  if params[:resource_name].nil?
64
64
  flash[:error] = I18n.t('generic_resources.controller.flash.error.resource_type_missing')
65
- redirect_to :back
65
+ redirect_to action: :index
66
66
  elsif GenericResource.resources[params[:resource_name]].nil?
67
67
  flash[:error] = I18n.t('generic_resources.controller.flash.error.resource_type_not_found', resource_name: params[:resource_name])
68
- redirect_to :back
68
+ redirect_to action: :index
69
69
  else
70
70
  @resource_class = GenericResource.resources[params[:resource_name]][:class]
71
71
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  <% if defined?(CaptainHooks) %>
6
6
  <div class="spacer"><%= render_captain_hooks_for("generic_resource_form_#{@resource_class.model_name.singular}".to_sym, { f: f} ) %></div>
7
- <% end %>
7
+ <% end %>
8
+
9
+ <%= f.submit t("generic_resources.forms.save_resource", resource_name: @resource_class.model_name.human) %>
8
10
 
9
- <%= f.submit t("generic_resources.forms.create_resource", resource_name: @resource_class.model_name.human) %>
@@ -1,3 +1,8 @@
1
1
  <%= form_for @resource, url: generic_resources.generic_resources_resource_path, html: { method: :patch, multipart: true} do |f| %>
2
2
  <%= render "/generic_resources/form", f: f %>
3
+ <% end %>
4
+
5
+ <% if GenericResource.resources[params[:resource_name]][:resource_deleteable] %>
6
+ <br />
7
+ <%= link_to t("generic_resources.forms.delete_resource"), generic_resources.generic_resources_resource_path, method: :delete, data: { confirm: t("generic_resources.forms.delete_confirm") } %>
3
8
  <% end %>
@@ -14,6 +14,9 @@ de:
14
14
  notice:
15
15
  created: "%{resource_name} wurde erfolgreich angelegt"
16
16
  updated: "%{resource_name} wurde erfolgreich aktualisiert"
17
+ destroyed: "%{resource_name} wurde erfolgreich gelöscht"
17
18
  forms:
18
19
  save_resource: "%{resource_name} speichern"
19
20
  create_resource: "%{resource_name} anlegen"
21
+ delete_resource: "Eintrag löschen"
22
+ delete_confirm: "Sicher? Das löschen kann nicht rückgängig gemacht werden"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generic_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Eck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-25 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Use just one Controller to CRUD all your resources instead of having
56
- lots of of scaffold controllers
56
+ lots of scaffold controllers
57
57
  email: florian.eck@el-digital.de
58
58
  executables: []
59
59
  extensions: []