osem-fcy/app/helpers/sponsors_helper.rb
Aditya Prakash af08d843a8 Maintain size of sponsor logos
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.
2016-04-21 19:51:24 +05:30

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