rich 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -100,7 +100,6 @@ To use the image picker on a string field, do this:
100
100
 
101
101
  field :title, :rich_picker do
102
102
  config({
103
- :type => 'image',
104
103
  :allowed_styles => [:original],
105
104
  :view_mode => "list"
106
105
  })
@@ -108,9 +107,12 @@ To use the image picker on a string field, do this:
108
107
 
109
108
  == Screenshots
110
109
 
111
- This is the editor with default settings.
110
+ This is the editor with default settings (shown here in Rails Admin).
112
111
  {<img src="https://github.com/bastiaanterhorst/rich/raw/master/screenshots/rich-editor-default.png" />}[https://github.com/bastiaanterhorst/rich/]
113
112
 
113
+ This is the file picker (Rich without CKEditor, again in Rails Admin).
114
+ {<img src="https://github.com/bastiaanterhorst/rich/raw/master/screenshots/rich-picker.png" />}[https://github.com/bastiaanterhorst/rich/]
115
+
114
116
  This is the file manager.
115
117
  {<img src="https://github.com/bastiaanterhorst/rich/raw/master/screenshots/rich-filemanager.png" />}[https://github.com/bastiaanterhorst/rich/]
116
118
 
@@ -170,7 +172,7 @@ To enable uploads of non-image files, set the following in your Rich initializer
170
172
 
171
173
  This will enable a new button on your CKEditor toolbar where you can upload regular files. Keep in mind that even if an image is uploaded through this method, it will not go through any processing you might have set up for your images.
172
174
 
173
- Non-image uploads also work from within the file picker. A Rails Admin example:
175
+ Non-image uploads also work from within the file picker when you pass in the <tt>:type => 'file'</tt> option. A Rails Admin example:
174
176
 
175
177
  field :title, :rich_picker do
176
178
  config({
@@ -13,7 +13,13 @@ module RailsAdmin::Config::Fields::Types
13
13
  end
14
14
 
15
15
  def scope_type
16
- bindings[:form].object_name
16
+
17
+ # Use association name if existent
18
+ if bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).nil?
19
+ bindings[:form].object_name
20
+ else
21
+ bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).to_s
22
+ end
17
23
  end
18
24
 
19
25
  def scope_id
data/lib/rich/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rich
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rich
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bastiaan Terhorst
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-06 00:00:00 Z
18
+ date: 2012-02-08 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails