Added check for image_tag occurences.

Checking for presence of a image before using image_tag
Fixes #1909
This commit is contained in:
Rishabh Singh 2017-12-26 13:57:32 +05:30
parent b148a553ca
commit 101402bb95
3 changed files with 5 additions and 3 deletions

View file

@ -19,6 +19,7 @@
- @conference.sponsors.each do |sponsor| - @conference.sponsors.each do |sponsor|
%tr %tr
%td %td
- if sponsor.picture?
= image_tag(sponsor.picture.thumb.url, width: '20%') = image_tag(sponsor.picture.thumb.url, width: '20%')
%td %td
= sponsor.name = sponsor.name

View file

@ -15,6 +15,7 @@
- if object.is_a? Sponsor - if object.is_a? Sponsor
- img_classes << ['img-sponsor', - img_classes << ['img-sponsor',
"img-sponsor-#{object.sponsorship_level.position}"] "img-sponsor-#{object.sponsorship_level.position}"]
- if object.picture?
= image_tag get_logo(object), class: img_classes = image_tag get_logo(object), class: img_classes
%p.description %p.description
= object.description = object.description

View file

@ -29,7 +29,7 @@
- if @conference.registration_open? - if @conference.registration_open?
= render 'registration', conference: @conference, = render 'registration', conference: @conference,
registration_period: @conference.registration_period, registration_period: @conference.registration_period,
tickets: @tickets, conference_id: @conference_id.short_title tickets: @tickets, conference_id: @conference.short_title
- if @conference.splashpage.include_tickets && @conference.tickets.any? - if @conference.splashpage.include_tickets && @conference.tickets.any?
= render 'tickets', conference: @conference, tickets: @tickets = render 'tickets', conference: @conference, tickets: @tickets