Check if commercial has versions before displaying commercial creator

This commit is contained in:
Nishanth Vijayan 2016-11-16 12:55:00 +05:30
parent 6c39d34322
commit 8a0ce67daa

View file

@ -40,6 +40,7 @@
- if can? :destroy, commercial
= link_to 'Delete', conference_program_proposal_commercial_path(@conference.short_title, @event.id, commercial.id),
:method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger'
.text-right
= "added by "
= link_to_user(commercial.versions.last.whodunnit)
- if commercial.versions.any?
.text-right
= "added by "
= link_to_user(commercial.versions.last.whodunnit)