Class: Simpleadmin::Decorators::Fields::Image
- Defined in:
- lib/simpleadmin/decorators/fields/image.rb
Overview
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Simpleadmin::Decorators::Fields::Base
Instance Method Details
#call ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/simpleadmin/decorators/fields/image.rb', line 7 def call record = model.find(resource[:id]) if record.public_send(table_field_name).respond_to?(:url) record.public_send(table_field_name).url else raise TypeError, "The column #{table_field_name} doesn't support image format" end end |