Module: GeneratedImagesHelper
- Defined in:
- app/helpers/generated_images_helper.rb
Overview
View helper: generated images.
Instance Method Summary collapse
-
#source_record_suggested_title(record) ⇒ String?
Returns a sensible default title for the imported image based on the source record.
-
#source_record_tags(record) ⇒ Array<String>
Returns the tags that should be pre-selected on import for a given source record.
Instance Method Details
#source_record_suggested_title(record) ⇒ String?
Returns a sensible default title for the imported image based on the source record.
Returns nil when no source record is present, allowing the caller to fall back.
22 23 24 25 26 27 |
# File 'app/helpers/generated_images_helper.rb', line 22 def source_record_suggested_title(record) case record when ReviewsIo "Avatar — #{record..presence || 'Review'} ##{record.id}" end end |
#source_record_tags(record) ⇒ Array<String>
Returns the tags that should be pre-selected on import for a given source record.
Add a new when clause as new source record types are supported.
10 11 12 13 14 15 |
# File 'app/helpers/generated_images_helper.rb', line 10 def (record) case record when ReviewsIo then ['review-avatar'] else [] end end |