Ruby on Rails Thursday, January 1, 2015

I successfully got the JS functioning on the index page with the url
provided in the example for the gem. But, the javascript didn't run for
images in my assets folder and it stopped working when I refreshed the
page using the array to add multiple images. I'm using
https://github.com/socialreferral/backstretch-rails

application.js
//= require 'jquery.backstretch'

Here's just a layout of my code

<body>
--Underneath final <Div> --
<script type="text/javascript" src="jquery.backstretch"></script> <=
fires off ActionController::RoutingError (No route matches [GET]
"/jquery.backstretch.js"):

<script>
$(document).ready(function() {
$.backstretch([
"<%= image_tag '1.png' %>"
, "<%= image_tag '2.png' %>"
, "<%= image_tag '3.png' %>"
], {duration: 3000, fade: 750});
});
</script>
</body>

Disclaimer: The console does show Backstretch being loaded. But, the
background only changed once, and that was with the url provided on
their demo.
If you can try to duplicate the problem with a test app. That might give
me a clue and lead to a real solution. Thank you.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2f68359d4fc6beb52f6f1acbdbb44da8%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment