Class: Decidim::NavigationMaps::BlueprintForm

Inherits:
Form
  • Object
show all
Includes:
TranslatableAttributes
Defined in:
app/forms/decidim/navigation_maps/blueprint_form.rb

Overview

A form object used to configure the blueprint content block from the admin panel.

Instance Method Summary collapse

Instance Method Details

#identObject

errors.add(:image, “no image”) unless image.present?

errors.add(:blueprint, "no blueprint") unless blueprint.present?

end



32
33
34
# File 'app/forms/decidim/navigation_maps/blueprint_form.rb', line 32

def ident
  id || "_"
end

#image?Boolean

Returns:

  • (Boolean)


36
37
38
39
# File 'app/forms/decidim/navigation_maps/blueprint_form.rb', line 36

def image?
  return unless image && image.respond_to?(:url)
  return image.content_type.start_with? "image" if image.content_type.present?
end