ruby on rails - Background image not showing up, when i came back on page across menu -


When I'm displaying a page background image, but after returning to the page image that appears in Chrome (all in Safari - OK)

Use a paperclip

In my opinion (some code on HAML + rail):

  # list-projects - @ Projects.each do | Project | .project {: style = & gt; "Background: url ('# {project.photo.url (: preview_16x9)}') No-repeat;"}  

Obtain this html:

 < Code> & lt; Div id = "list-project" & gt; & Lt; Div class = "project" style = "background: url ('/ system / project / photo / 000/000/001 / preview_16x9 / franchisee. Jpg? 1392386916') no-repeat;" & Gt; & Lt; A href = "/ Projects / 1" & gt; & Lt; / A & gt; & Lt; Div class = "description" & gt; & Lt; H3 & gt; Shop Number Two & lt; / H3 & gt; & Lt; H4 & gt; Class - 305mu & lt; Sup> 2 & lt; / Sup>. & Lt; / H4 & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "project" style = "background: url ('/ system / projects / photos / 000/000/002 / preview_16x9 / franchi.jpg? 13 92310632') no-repeat;" & Gt; & Lt; A href = "/ Projects / 2" & gt; & Lt; / A & gt; & Lt; Div class = "description" & gt; & Lt; H3 & gt; Shop Number One & lt; / H3 & gt; & Lt; H4 & gt; Class - 305mu & lt; Sup> 2 & lt; / Sup>. & Lt; / H4 & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

upd:

Navigation generated by this code (Rail, HAM)

 % nav # mainmenu% li {class: current_page? (Root_path) & amp; Amp; 'Active'} = link_to_unless_current 'Projetcs', root_path% li {class: current_page? (Contact_path) & amp; Amp; 'Active'} = link_to_unless_current 'contact', contact_path  

# solving by adding the request .protocol } # {Request.host_with_port}

#project {: style = & gt; "Background: URL ('# {request.protocol} # {request.host_with_port} # {project.photo.url}') No-repeat;"}

This is a turboilined gem problem thanks


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -