Places logo on a white background if image is smaller than the given
constrains.
Resizes the logo if image is larger than constrains.
Validation of presence of logo was moved cause file field wasn't getting
marked as required field ('*' thingy) in form.
`- if logo presence` was removed cause logo is mandatory field.
12 lines
344 B
Ruby
12 lines
344 B
Ruby
module SponsorsHelper
|
|
# returns the url to be used for logo on basis of sponsorship level position
|
|
def get_logo(sponsor)
|
|
if sponsor.sponsorship_level.position == 1
|
|
sponsor.logo.url(:first)
|
|
elsif sponsor.sponsorship_level.position == 2
|
|
sponsor.logo.url(:second)
|
|
else
|
|
sponsor.logo.url(:others)
|
|
end
|
|
end
|
|
end
|