Method: Binda::FieldableAssociationHelpers::FieldableImageHelpers#get_image_dimension

Defined in:
app/models/concerns/binda/fieldable_association_helpers/fieldable_image_helpers.rb

#get_image_dimension(field_slug) ⇒ hash

Get image dimension

Parameters:

  • field_slug (string)

    The slug of the field setting

Returns:

  • (hash)

    with width and height as floats



80
81
82
83
# File 'app/models/concerns/binda/fieldable_association_helpers/fieldable_image_helpers.rb', line 80

def get_image_dimension(field_slug)
	obj = self.images.find{ |t| t.field_setting_id == FieldSetting.get_id( field_slug ) }
   	return { width: obj.file_width, height: obj.file_height }
end