adminable 0.0.4 → 0.0.5
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 +4 -4
- data/README.md +14 -0
- data/app/controllers/adminable/resources_controller.rb +2 -3
- data/lib/adminable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50dbc10813e44d6cbaafaf677198e95604541bd9
|
4
|
+
data.tar.gz: 1a583fe099f1a41a986ff8e61b2deb632dae6e9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f46365f19a81adde1666e349976db7626b32a396db05ef6546e9e1a2681816ec4b66c7c02e782a4e8d687ffec705c873550311eb3efbf96cd76dec9fff1af2b
|
7
|
+
data.tar.gz: e735b3c8245ba04e89450b6bf444d9e628eeaa816498875a91fb3d0a6e3918431cc3993f8b6b08b531595b1a3ebb8316af1e022b15204fd2e061d2ccfe2feeeb
|
data/README.md
CHANGED
@@ -149,6 +149,20 @@ You can use generator to copy original partial to your application.
|
|
149
149
|
* `type` - `string`, `text` etc. See [Built-in Attributes](#built-in-attributes).
|
150
150
|
* `resource` - Use controller name (e.g. `users`) to replace partial only for single controller or leave blank to replace partials for all controllers.
|
151
151
|
|
152
|
+
## F.A.Q
|
153
|
+
|
154
|
+
##### If model to_param method was overridden
|
155
|
+
|
156
|
+
```ruby
|
157
|
+
class Adminable::Blog::PostsController < Adminable::ResourcesController
|
158
|
+
def set_entry
|
159
|
+
entry = @resource.model.find_by(slug: params[:id])
|
160
|
+
|
161
|
+
super
|
162
|
+
end
|
163
|
+
end
|
164
|
+
```
|
165
|
+
|
152
166
|
## Contributing
|
153
167
|
|
154
168
|
1. Fork it (https://github.com/droptheplot/adminable/fork)
|
@@ -103,9 +103,8 @@ module Adminable
|
|
103
103
|
private
|
104
104
|
|
105
105
|
def set_entry
|
106
|
-
|
107
|
-
|
108
|
-
)
|
106
|
+
entry ||= @resource.model.find(params[:id])
|
107
|
+
@entry = Adminable::Presenters::Entry.new(entry)
|
109
108
|
end
|
110
109
|
|
111
110
|
def resource_model_name
|
data/lib/adminable/version.rb
CHANGED