weeler 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.md +21 -0
- data/README.md +15 -0
- data/app/views/weeler/translations/_translation.html.haml +4 -3
- data/app/views/weeler/translations/index.html.haml +2 -1
- data/lib/weeler/action_controller/acts/restful.rb +15 -3
- data/lib/weeler/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d74bf1a8c861ad71e165a61811adf25b4b702742
|
4
|
+
data.tar.gz: 72c0e430791b689a12e7e35b43cd7fef68290206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26bc83df02c82b16027f4c355ea87ced1eed41d50ead778fb8d7bedf1be2673db0f3a0dbabc7a968e0ff0d2a74d85ed91527ac5b293a538b122d7be7c357f585
|
7
|
+
data.tar.gz: 813211cdb75e8717382e47a44f4b669de769a1f92f58f26126deda5b8887fc650cb4576f06c2795567bf8794213194d957547502bcecb41360d977b80f72363d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## 1.2.0
|
2
|
+
|
3
|
+
### Features & Enhancements
|
4
|
+
|
5
|
+
* Added option to override acts as restful create, update, destroy redirect path
|
6
|
+
|
7
|
+
### Contributors
|
8
|
+
|
9
|
+
* Artis Raugulis
|
10
|
+
|
11
|
+
|
12
|
+
## 1.1.1
|
13
|
+
|
14
|
+
### Features & Enhancements
|
15
|
+
|
16
|
+
* Improved working with translations by removing rowlink.
|
17
|
+
|
18
|
+
### Contributors
|
19
|
+
|
20
|
+
* Artis Raugulis
|
21
|
+
|
1
22
|
## 1.1.0
|
2
23
|
|
3
24
|
### Features & Enhancements
|
data/README.md
CHANGED
@@ -109,6 +109,21 @@ It will handle <tt>:index</tt>, <tt>:new</tt>, <tt>:edit</tt>, <tt>:update</tt>,
|
|
109
109
|
For permiting custom by role or permiting all params (permit!),
|
110
110
|
you must add block <tt>permit_params: -> (params) { params.require(:post).permit! }</tt>
|
111
111
|
|
112
|
+
You can override redirect path after <tt>:create</tt>, <tt>:update</tt>, <tt>:destroy</tt> actions.
|
113
|
+
You can do this by overriding private methods in your controller.
|
114
|
+
|
115
|
+
def after_create_path
|
116
|
+
{ action: :edit, id: @item.id }
|
117
|
+
end
|
118
|
+
|
119
|
+
def after_update_path
|
120
|
+
{ action: :edit, id: @item.id }
|
121
|
+
end
|
122
|
+
|
123
|
+
def after_destroy_path
|
124
|
+
{ action: :index }
|
125
|
+
end
|
126
|
+
|
112
127
|
You should implement form file with your own active record attributes.
|
113
128
|
To do that, create <tt>_form.html.haml</tt> in <tt>views/weeler/_YOUR_RESOURCE_/_form.html.haml</tt>
|
114
129
|
where <tt>_YOUR_RESOURCE_</tt> is name of your resource.
|
@@ -1,7 +1,5 @@
|
|
1
1
|
%tr
|
2
|
-
%td
|
3
|
-
%a{href: edit_weeler_translation_path(translation.id)}
|
4
|
-
\ #{translation.locale}
|
2
|
+
%td= translation.locale
|
5
3
|
%td= translation.key
|
6
4
|
- if translation.value.present? && translation.value.is_a?(String)
|
7
5
|
%td= strip_tags(truncate(translation.value, lenght: 50))
|
@@ -9,3 +7,6 @@
|
|
9
7
|
%td= translation.value
|
10
8
|
%td= translation.interpolations
|
11
9
|
%td.text-center= translation.created_at.strftime("%d/%m/%Y")
|
10
|
+
%td
|
11
|
+
= link_to 'Edit', edit_weeler_translation_path(translation.id), class: 'btn btn-default'
|
12
|
+
= link_to 'Remove', weeler_translation_path(translation), data: { confirm: 'Are you sure you want to remove?' }, method: :delete, class: 'btn btn-danger'
|
@@ -60,7 +60,7 @@
|
|
60
60
|
.container
|
61
61
|
.row
|
62
62
|
.col-lg-12
|
63
|
-
%table.table.table-hover
|
63
|
+
%table.table.table-hover
|
64
64
|
%thead
|
65
65
|
%tr
|
66
66
|
%th Locale
|
@@ -68,6 +68,7 @@
|
|
68
68
|
%th.text-center Value
|
69
69
|
%th.text-center Interpolations
|
70
70
|
%th.text-center Created
|
71
|
+
%th
|
71
72
|
%tbody#translations
|
72
73
|
- @translations.each do |translation|
|
73
74
|
= render :partial => "weeler/translations/translation", locals: {translation: translation}
|
@@ -83,7 +83,7 @@ module Weeler
|
|
83
83
|
def create
|
84
84
|
@item = model.new(items_params)
|
85
85
|
if @item.save
|
86
|
-
redirect_to(
|
86
|
+
redirect_to( after_create_path, {:notice => "Successfully created item"} )
|
87
87
|
else
|
88
88
|
render :action => 'new'
|
89
89
|
end
|
@@ -91,7 +91,7 @@ module Weeler
|
|
91
91
|
|
92
92
|
def update
|
93
93
|
if @item.update_attributes(items_params)
|
94
|
-
redirect_to(
|
94
|
+
redirect_to( after_update_path, {:notice => "Successfully updated item"} )
|
95
95
|
else
|
96
96
|
render :action => 'edit'
|
97
97
|
end
|
@@ -99,7 +99,7 @@ module Weeler
|
|
99
99
|
|
100
100
|
def destroy
|
101
101
|
@item.destroy
|
102
|
-
redirect_to(
|
102
|
+
redirect_to( after_destroy_path, {:notice => "Successfully destroyed item"})
|
103
103
|
end
|
104
104
|
|
105
105
|
def remove_image
|
@@ -142,6 +142,18 @@ module Weeler
|
|
142
142
|
|
143
143
|
private
|
144
144
|
|
145
|
+
def after_create_path
|
146
|
+
{ action: :edit, id: @item.id }
|
147
|
+
end
|
148
|
+
|
149
|
+
def after_update_path
|
150
|
+
{ action: :edit, id: @item.id }
|
151
|
+
end
|
152
|
+
|
153
|
+
def after_destroy_path
|
154
|
+
{ action: :index }
|
155
|
+
end
|
156
|
+
|
145
157
|
def model
|
146
158
|
model
|
147
159
|
end
|
data/lib/weeler/version.rb
CHANGED
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weeler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artūrs Braučs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -540,7 +540,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
540
540
|
version: '0'
|
541
541
|
requirements: []
|
542
542
|
rubyforge_project:
|
543
|
-
rubygems_version: 2.4.
|
543
|
+
rubygems_version: 2.4.7
|
544
544
|
signing_key:
|
545
545
|
specification_version: 4
|
546
546
|
summary: CMS for weby.lv projects.
|