Ruby on Rails variables and JavaScript-files -


i looking posibility change variables via ruby on rails in javascript-file.

thats do:

page.js.erb

var page = {   settings: {     locale: '<%= i18n.locale %>'   } } 

if locale changes (by swichting page.com/de/ page.com/en/) javascript not change value of page.settings.locale . how fix this?

only editing file value changed. think kind of server-side-caching.


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

ruby - How do I merge two hashes into a hash of arrays? -