KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this code-snippet in html erb. For some objects the cover_image_url is empty, how do i modify this code block to use a default value ,when that property is null or empty? <%@books.each do |book|%> $('#bookContainer').append('<div class="conn"><p><img class="floatright" src="<%= h book.cover_image_url%>"><h3><%= h book.title%></h3><h3><%= h book.author%></h3></p></div>'); <% end %>
Tags (comma-separated)
Save Edits
Cancel