redde 0.1.12 → 0.1.13

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
  SHA1:
3
- metadata.gz: c650f367f9c4c696a0f975c34f1a10287b6507e6
4
- data.tar.gz: de8fbf3cc2b6690af278d375b674f1a85e4ffa3e
3
+ metadata.gz: e4d22bf707a9ac4a22cae710807c49915b5eb428
4
+ data.tar.gz: f5575cc481711dbe2ac70ae0abc03076e4c84437
5
5
  SHA512:
6
- metadata.gz: d2dfb6a0e1eef465be5552e17fea2e27471d1b5b2763b431f9f979132f8e9537c457437f725fc8d60fc27ec0e8f349132d4146987fb0d2a3e7018e3449fdaf69
7
- data.tar.gz: a763c62d364283ddb495b72e348ff022379934d5e5eccf71fe15c948442057d5f360e946ab6e16dcb98efc4704493925bab3a37d99965d546d24312673401db0
6
+ metadata.gz: a90b38b23de838c5c759c67d726e8d8ebc26e6b5007b3f891d3cc4754e137314cdef1a7b56e9c47f423c12a1e8a863d6637c1f428289a2417bdb34e292767582
7
+ data.tar.gz: 838c913d034d501d784823cde7fac21210a929373e07556deb755f9c57f37ef238e4d43335493c9a5c4bf9f815a728f6f665800804814d6a2723b7cc986166b5
@@ -8,16 +8,17 @@ class Admin::BaseController < ActionController::Base
8
8
 
9
9
  private
10
10
 
11
- def redirect_or_edit(obj, saved)
11
+ def redirect_or_edit(obj, saved, notice = nil)
12
12
  if saved
13
- redirect_to url_for_obj(obj), notice: notice_for(obj)
13
+ redirect_to url_for_obj(obj), notice: notice_for(obj, notice)
14
14
  else
15
15
  render 'edit'
16
16
  end
17
17
  end
18
18
 
19
- def notice_for(obj)
20
- "#{obj.class.model_name.human} сохранен."
19
+ def notice_for(obj, notice = nil)
20
+ notice ||= 'сохранен'
21
+ "#{obj.class.model_name.human} #{notice}."
21
22
  end
22
23
 
23
24
  def url_for_obj(obj)
@@ -40,6 +40,6 @@ class Admin::<%= model_name.demodulize.pluralize -%>Controller < Admin::BaseCont
40
40
  private
41
41
 
42
42
  def <%= resource_name %>_params
43
- params.require(:<%= resource_name %>).permit(<%= column_names.select {|c| !(['id', 'updated_at', 'created_at'].include? c) }.map { |c| ":#{c}" }.join(', ') %>)
43
+ params.require(:<%= resource_name %>).permit!
44
44
  end
45
45
  end
@@ -1,10 +1,10 @@
1
1
  - content_for(:page_header) do
2
2
  %h1= tplural <%= model_name.demodulize %>
3
3
  %p= link_to "Добавить #{taccusative('<%= resource_name %>')}", [:new, :admin, :<%= resource_name %>]
4
-
4
+
5
5
  - unless @<%= plural_resource_name %>.empty?
6
6
  %table.list<%= ".sortable" if column_names.include?('position') %>
7
- %colgroup
7
+ %colgroup
8
8
  <%- columns.each do |column| -%>
9
9
  %col<%= '.w1' if ['position', 'visible'].include? column.name %>
10
10
  <%- end -%>
@@ -30,8 +30,8 @@
30
30
  %td= link_to <%= resource_name %>.<%= column.name %>, [:edit, :admin, <%= resource_name %>]
31
31
  <%- end -%>
32
32
  <%- end -%>
33
- %td= link_to 'Удалить', [:admin, <%= resource_name %>], method: :delete, data: { confirm: 'Точно Удалить?'' }, class: :del
34
-
33
+ %td= link_to 'Удалить', [:admin, <%= resource_name %>], method: :delete, data: { confirm: 'Точно Удалить?' }, class: :del
34
+
35
35
  <%- if column_names.include?('position') -%>
36
36
  = sortable sort_admin_<%= plural_resource_name %>_path
37
37
  <%- end -%>
data/lib/redde/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redde
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redde
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Bovykin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-17 00:00:00.000000000 Z
12
+ date: 2014-06-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails