app/views/pages_cms/articles/index.html.erb in pages_cms-0.0.3 vs app/views/pages_cms/articles/index.html.erb in pages_cms-0.1.0
- old
+ new
@@ -4,13 +4,13 @@
<label>Search</label>
<%= text_field_tag :search, params[:search], class: 'form-control inline-form' %>
<% end %>
<% @articles.each do |post| %>
- <% unless post.image.nil? %>
- <div class="image-post" style="background: url(<%= "/images/#{post.image.file}" %>) no-repeat center center;"></div>
- <% end %>
<div class="content">
+ <% unless post.image.nil? %>
+ <div class="image-post" ><%= image_tag post.image.file %></div>
+ <% end %>
<div style="cursor: pointer;" onclick="window.location='/articles/<%= post.id.to_s %>';">
<h2 class="center"><%= post.title %></h2>
<h6>Posted <%= post.created_at.strftime("%B %d") %></h6>
<p><%= truncate(post.content, length: 200) %></p>
</div>
\ No newline at end of file