View Single Post
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 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.


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)
if (glidearray.length>0)

function onebyoneglide(){
if (curobjindex<glidearray.length)

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

if (window.addEventListener)
window.addEventListener("load", collectElementbyClass, false)
else if (window.attachEvent)
window.attachEvent("onload", collectElementbyClass)
else if (document.getElementById)
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.