Getting an exception with Refile Gem when user avatar image isn't available

8 views
Skip to first unread message

David Williams

unread,
Jan 21, 2015, 6:05:35 PM1/21/15
to rubyonra...@googlegroups.com
module MessagesHelper

def recipients_options
s = ''
users = User.all + BizUser.all; users.each do |user|
s << "<option value='#{user.id}'
data-img-src='#{attachment_url(@user, user.email, :profile_avatar,
:fill, 50, 50)}'>#{user.username}</option>"
end
s.html_safe
end
end

How would I pass if nil to the attachment_url for user :profile_avatar?
when the image isn't available.

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages