rhomobile - integrating images in ruby command -
i have index.erb , want show picture dependent on condition. so, choose if loop, don´t know how call image written in html within ruby command? perhaps it´s easy, don´t have idea, because i´m newbie ;).
<%= if (condition 1 < 40) picture 1 elsif (condition 2 > 70) picture 2 else picture 3 end %> <img src="/public/images/picture1.png"> <img src="/public/images/picture2.png"> <img src="/public/images/picture3.png">
please :)
i'm not sure if whether want, i'd try anyway...
<% if condition 1 %> <img src="/public/images/picture1.png"> <% elsif condition 2 %> <img src="/public/images/picture2.png"> <% else %> <img src="/public/images/picture3.png"> <% end %>
change condition 1 , condition 2 conditional code want...
Comments
Post a Comment