Class: CckForms::ParameterTypeClass::Image
- Inherits:
-
File
- Object
- File
- CckForms::ParameterTypeClass::Image
- Defined in:
- lib/cck_forms/parameter_type_class/image.rb
Overview
Represents a single image. A subclass of File.
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #file_type ⇒ Object
-
#to_diff_value(options = {}) ⇒ Object
Returns a 64x64 IMG.
Class Method Details
.file_type ⇒ Object
4 5 6 |
# File 'lib/cck_forms/parameter_type_class/image.rb', line 4 def self.file_type ::Neofiles::Image end |
Instance Method Details
#file_type ⇒ Object
8 9 10 |
# File 'lib/cck_forms/parameter_type_class/image.rb', line 8 def file_type self.class.file_type end |
#to_diff_value(options = {}) ⇒ Object
Returns a 64x64 IMG
13 14 15 16 17 18 19 20 |
# File 'lib/cck_forms/parameter_type_class/image.rb', line 13 def to_diff_value( = {}) view_context = [:view_context] if value.present? id = value.is_a?(BSON::Document) ? value['_id'] : value "<img style='width: 64px; height: 64px;' src='#{view_context.neofiles_image_path(id: id, format: '64x64', crop: 1)}'>".html_safe end end |