FAQ Database Discussion Community


Rails ExecJS::ProgramError in Pages#home?

ruby-on-rails,windows,turbolinks,execjs
Starting a new app, when I create a controller page home and try to go to local host:3000/pages/home, I get the following error: Showing c:/Users/Doesha/desktop/pinplug/app/views/layouts/application.html.erb where line #6 raised: TypeError: Object doesn't support this property or method (in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee) application.html.erb file: <!DOCTYPE html> <html> <head> <title>Pinplug</title> <%= stylesheet_link_tag...

Rails 4 - eager loading on dependent select causing error (Rails4/Active Admin)

javascript,ruby-on-rails,ruby-on-rails-4,activeadmin,turbolinks
I have an Active panel with a dependent select i.e. the choice on the first dropdown select impacts what appears in the second drop-down. All was working perfectly well a few months ago but i just realized yesterday it is not working any more. I managed to find what cause...

Preventing flash from loading on undesired pages while using Rails and Turbo Links

ruby-on-rails,turbolinks
I have a problem with my flash message lingering on pages that I don't want it to appear on. I'm using Rails 4 with turbo links. While I very much like turbo links, I think it might be the problem here. In my rails controller I'm setting the desire flash...

Turbolinks & Ladda

jquery,ruby-on-rails,turbolinks
I'm trying to use Turbolinks 3.0 and Ladda together in a Rails application. The ladda documentation states: "If you will be using the loading animation for a form that is submitted to the server (always resulting in a page reload) you can use the bind() method" Which is what I...

JQuery conflict in Rails 4 app using Bootstrap

javascript,jquery,ruby-on-rails,twitter-bootstrap,turbolinks
I've added a couple of JQuery functions to my Rails 4.1.8 application which uses Bootstrap 3. These functions are to solve the issue of applying the "active" styling to the current navigation tab. The functions work well to remove the active class and apply it to the clicked tab, which...

Rails 4, Turbolinks, and Google Analytics - Tracking async modal clicks invalidates regular tracking

ruby-on-rails-4,asynchronous,google-analytics,turbolinks
I have set up Google Analytics tracking in my Rails 4 app with help from this SO answer. Page tracking is working just fine. In my app, users can click on a link, and a Bootstrap modal will pop up. I want to track whenever the modal pops up, so...

javascript_include_tag throws unsupported method

ruby-on-rails,ruby-on-rails-4,turbolinks
I recently created a new project with Rails 4.2.0 and created a controller called Land for the landing page. So, I ran into this error upon visting http://localhost:3000/land/home: Started GET "/" for ::1 at 2015-02-27 15:56:23 -0600 Processing by LandController#home as HTML Rendered land/home.html.erb within layouts/application (0.0ms) Completed 500 Internal...

Rails: Bootstrap Collapse doesn't work after refresh

jquery,ruby-on-rails,twitter-bootstrap,turbolinks
I have a simple Bootstrap collapse (as seen working in this fiddle): <h3> <a data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> OUR NAME</a> </h3> <div class="collapse" id="collapseExample"> <p> Stuff about our name. <p> </div> <h3> <a data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> THE BOTTOM LINE BASICS</a> </h3> <div class="collapse" id="collapseTwo"> <p> More...

How do I stop HTML5 audio upon page refresh in Firefox

ruby-on-rails,firefox,html5-audio,turbolinks
Within my Rails app, I have a view where, when you refresh the page, a new song plays. When I manually refresh the page, the old song stops and a new song starts playing. But, in Firefox, when I click on a button inside the view to refresh the page,...

How to enable `sorttable.js` on Rails4 with turbolinks

javascript,ruby-on-rails,ruby-on-rails-4,turbolinks
Rails 4.2.0, turbolinks (2.5.3) jquery-rails (4.0.3), jquery-ui-rails (5.0.3) sorttable.js App used on Chrome, Firefox, and IE WHAT SHOULD HAPPEN: Whether a redirect, render, or just clicking to a new page in the app, any table with class sorttable (I edited it in the original JS) should be sortable by...

First load time app loads using Gmaps4rails gem map won't load

jquery,ruby-on-rails-4,turbolinks,gmaps4rails2
I've been banging my head with this for 2 days now and have read every post on here and tried just about everything. Here is my JS, everything works after 1st page refresh but when launch new browser, fails first time map is called. I'm getting error: Uncaught TypeError: Cannot...

Turbolinks, limit javascript to one page

ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,turbolinks,highlight.js
I am using highlight.js and applying this code to initialise the syntax highlighting for my code snippets on a blog app. The following code is on my index.html page : <script> $(document).on('ready page:load', function() { $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); }); </script> A code snippet should look like this originally: <pre><code>A...

using jQuery's delegated event on() within every turbolinks page:load

jquery,ruby-on-rails,ruby-on-rails-4,javascript-events,turbolinks
I had this code in my rails app: $(document).ready( function() { myCustomFunction("#link-selector"); } function myCustomFunction(linkCssSelector){ // some stuff... $(document).on('click', linkCssSelector, function(){ // ...some other stuff... }); } The click event handling is already delegated to the document, but now I have to add Turbolinks to my app. Then, I would...

Fotorama jQuery Gallery with Rails 4.2.0 (Turbolinks issue)

javascript,jquery,html,ruby-on-rails,turbolinks
I've got the Fotorama jQuery Slider working; however, it doesn't work with Turbolinks (and I'd rather not disable Turbolinks). How can I make this jQuery slider load when the page that it's on is loaded through Turbolinks? In application.js I've got the following code for dealing with Turbolinks: var ready;...

CSS of typeahead not working with turbolinks on

css,ruby-on-rails,css3,turbolinks
The issue is regarding the movement of the text input box after pressing any link on the page. Turbolinks is on.[If this line of code is removed the problem gets fixed] //= require jquery.turbolinks Javascript associated with the search box works ok: var ready; ready = function() { $('.typeahead').typeahead(null, {...

d3js: How to stop all transitions?

ajax,d3.js,transition,turbolinks
I have a web-application with d3js and turbolinks (ajax navigation). Some of my pages contains a long-run transitions (over 100s), so when a part of the page was being reloaded with AJAX all the transitions from previous page are still running. How can I completely remove all the transitions from...

Rails turbolinks JS files Bug

javascript,jquery,ruby-on-rails,turbolinks
All my .js files look like this: function function_name(){ ..... some code ..... } $(document).ready(function_name); $(document).on('page:load', function_name); I use setInterval(some_function, 7000), Event handlers like $(document).on('click', '.blah-blah', function(){...}). Unfortunately, these stuff calls multiple times if I a have more than one request to server via turbolinks (using turbolinks session). Actually amount...

Rails, Turbolinks and Ajax

ruby-on-rails,ajax,turbolinks
It seems from reading the turbolinks docs that turbolinks can function as a kind of replacement for pjax. Do turbolinks always relace the entire body or is it possible to just update specific parts of the page? The doc seems to suggest that the latter is possible by tagging the...