Class: RailsAdmin::Config::Fields::Types::RichPicker
- Inherits:
-
Base
- Object
- Base
- RailsAdmin::Config::Fields::Types::RichPicker
- Defined in:
- lib/rich/rails_admin/config/fields/types/rich_picker.rb
Instance Method Summary collapse
Instance Method Details
#editor_options ⇒ Object
23 24 25 |
# File 'lib/rich/rails_admin/config/fields/types/rich_picker.rb', line 23 def Rich.(config, scope_type, scope_id) end |
#preview_image_path ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rich/rails_admin/config/fields/types/rich_picker.rb', line 27 def preview_image_path if value.to_s.html_safe != "" if (true if Float(value) rescue false) # if the value is numeric we assume its an object id rich_file = Rich::RichFile.find(value) rich_file.rich_file.url(:rich_thumb) else # if not, we assume its a url value.to_s end else # no value, show placeholder image [:placeholder_image] end end |
#scope_id ⇒ Object
19 20 21 |
# File 'lib/rich/rails_admin/config/fields/types/rich_picker.rb', line 19 def scope_id bindings[:object].id end |
#scope_type ⇒ Object
15 16 17 |
# File 'lib/rich/rails_admin/config/fields/types/rich_picker.rb', line 15 def scope_type bindings[:form].object_name end |