Answer the question
In order to leave comments, you need to log in
if doesn't work, what am I doing wrong?
Hello.
There is a helper
module ArticlesHelper
def image_from_amazon(amazon_id)
image_tag "http://images.amazon.com/images/P/#{amazon_id}.01.ZTZZZZZZ.jpg"
end
end
module ArticlesHelper
def image_from_amazon(amazon_id)
if amazon_id == nil
image_tag "http://vk.com/images/deactivated_100.png"
else
image_tag "http://images.amazon.com/images/P/#{amazon_id}.01.ZTZZZZZZ.jpg"
end
end
end
<img src="http://images.amazon.com/images/P/.01.ZTZZZZZZ.jpg" alt=".01.ztzzzzzz">
Answer the question
In order to leave comments, you need to log in
If you are using Rails, then it is amazon_id == nil
wiser to use amazon_id.blank?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question