Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting jQuery to work on rails app
    primarykey
    data
    text
    <p>My page worked locally before when it was just a static html page with jQuery. However, I built it on top of rails because I wanted free web hosting on heroku. </p> <p>All I did was move the jQuery into the application.js file and changed the application.html.erb file because that's all that's needed, right?</p> <p>I have the following included in my gemfile:</p> <pre><code>gem 'sqlite3' gem 'jquery-rails' gem 'thor' </code></pre> <p>Here's my Application.html.erb file:</p> <pre><code> &lt;head&gt; &lt;title&gt;Me&lt;/title&gt; &lt;%= stylesheet_link_tag :all %&gt; &lt;%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" %&gt; &lt;%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" %&gt; &lt;%= javascript_include_tag "jquery-rails.js" %&gt; &lt;%= javascript_include_tag "jquery.fancybox-1.3.4.js" %&gt; &lt;%= javascript_include_tag "jquery.fancybox-1.3.4.pack.js" %&gt; &lt;%= javascript_include_tag "jquery.fancybox-1.3.4.css" %&gt; &lt;%= javascript_include_tag "jquery.easing-1.3.pack.js" %&gt; &lt;%= javascript_include_tag "jquery.mousewheel-3.0.4.pack.js" %&gt; &lt;%= render 'layouts/stylesheets' %&gt; &lt;%= csrf_meta_tag %&gt; &lt;/head&gt; </code></pre> <p>And this is my application.js file:</p> <pre><code>// Place your application-specific JavaScript functions and classes here // This file is automatically included by javascript_include_tag :defaults $("a#example1").fancybox(); $("a#example2").fancybox({ 'overlayShow' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic' }); $("a#example3").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none' }); $("a#example4").fancybox({ 'opacity' : true, 'overlayShow' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'none' }); $("a#example5").fancybox(); $("a#example6").fancybox({ 'titlePosition' : 'outside', 'overlayColor' : '#000', 'overlayOpacity' : 0.9 }); $("a#example7").fancybox({ 'titlePosition' : 'inside' }); $("a#example8").fancybox({ 'titlePosition' : 'over' }); $("a[rel=example_group]").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'over', 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return '&lt;span id="fancybox-title-over"&gt;Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &amp;nbsp; ' + title : '') + '&lt;/span&gt;'; } }); /* * Examples - various */ $("#various1").fancybox({ 'titlePosition' : 'inside', 'transitionIn' : 'none', 'transitionOut' : 'none' }); $("#various2").fancybox(); $("#various3").fancybox({ 'width' : '75%', 'height' : '75%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' }); $("#various4").fancybox({ 'padding' : 0, 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none' }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload