When i open page background image showing, but after come back on the page image not showing up in chrome (in safari all - ok)
Use paperclip
In my view (some code on HAML + Rails):
#list-projects
- @projects.each do |project|
.project{:style => "background: url('#{project.photo.url(:preview_16x9)}') no-repeat ;"}
Get this html:
<div id="list-projects">
<div class="project" style="background: url('/system/projects/photos/000/000/001/preview_16x9/franchi.jpg?1392386916') no-repeat ;">
<a href="/projects/1"> </a>
<div class="description">
<h3>Shops number two</h3>
<h4>Square —
305 м<sup>2</sup>.</h4>
</div>
</div>
<div class="project" style="background: url('/system/projects/photos/000/000/002/preview_16x9/franchi.jpg?1392310632') no-repeat ;">
<a href="/projects/2"> </a>
<div class="description">
<h3>Shops number one</h3>
<h4>Square —
305 м<sup>2</sup>.</h4>
</div>
</div>
</div>
upd:
navigation generated by this code (rails, haml)
%nav#mainmenu
%li{class: current_page?(root_path) && 'active' }
= link_to_unless_current 'Projetcs', root_path
%li{class: current_page?(contacts_path) && 'active' }
= link_to_unless_current 'Contacts', contacts_path