Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-03-2020, 10:22 AM
Chudri 420's Avatar
Chudri 420 Chudri 420 is offline
Junior Member
 
Join Date: Jan 2020
Posts: 1
Default How to force refresh each page in rails

I can't seem to figure out how to turn of the cache successfully in my rails app. The website I made is http://www.liftlineclothing.com and upon using the navbar to click to the clothing page, the clothes do no appear unless you refresh the page once you are on it. As well, when navigating back to the homepage, the Javascript to get the text to fly in does not appear unless you refresh the page as well.

I am pretty sure this is a cache problem but if any one has some ideas, I would really appreciate it. I have gone in the config file and changed the rails cache to false.

UPDATE

here is the javascript

var pausebetweenmsg=10 //customize pause in miliseconds between each message showing up
(3000=3 seconds)
var glidespeed=50 //customize glide speed in pixels per frame.

var curobjindex=0

function actualstyle(el, cssproperty){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(cssproperty)
}
}

function collectElementbyClass(){
var classname="glidetext"
glidearray=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
glidearray[inc++]=alltags[i]
}
if (glidearray.length>0)
onebyoneglide()
}

function onebyoneglide(){
if (curobjindex<glidearray.length)
glidetimer=setInterval("glideroutine()",50)
}

function glideroutine(){
if (parseInt(actualstyle(glidearray[curobjindex], "left"))<0)
glidearray[curobjindex].style.left=parseInt(actualstyle(glidearray[curobjindex], "left"))+50+"px"
else{
glidearray[curobjindex].style.left=0
curobjindex++
clearInterval(glidetimer)
setTimeout("onebyoneglide()", pausebetweenmsg)
}
}

if (window.addEventListener)
window.addEventListener("load", collectElementbyClass, false)
else if (window.attachEvent)
window.attachEvent("onload", collectElementbyClass)
else if (document.getElementById)
window.onload=collectElementbyClass
This send the text flying onto the page from the homepage that is not working when navigated to from another page. You have to refresh the home page as well.

As for the clothing javascript, that is handle by ecwid. I will update once I can locate the specific javascript that is being used by them.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:26 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.