M
M
Max2015-06-04 18:51:21
Ruby on Rails
Max, 2015-06-04 18:51:21

Why doesn't JS work in rails?

Hello, I’ll start with the fact that I work on Windows, and it’s impossible to install Ubuntu on a PC, if it worked out, I would have worked there for a long time ..
The following problem, when loading the rails page, complains and gives an error in the line

<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>

As an option, I replaced "application" with "default" and the page began to load, but then CRUD does not work, or rather the destroy method. On the forums, they write that you can install node.js, but a simple installation did not help me, maybe I still need to configure it somehow ??
Error: TypeError: Object does not 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)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Kononenko, 2015-06-04
@maxprof

The problem is following while loading the rails page complains and throws an error on the line

Why don't you write the error itself? This is a fully functional code. Sprockets even work fine on Windows.
And it is necessary to deliver niksa. On Windows, half of the gems will not work. I'm talking about the console.
Solution: install nodejs and add the path to the node binary to the environment variables. Don't forget to restart the server.

D
dmitrii1, 2015-06-04
@dmitrii1

Install any Linux (ubuntu/fedora/debian/mint...) second OS or in a virtual machine. I assure you, writing rails code will become more convenient.

E
Erik_Omsk, 2015-11-22
@Erik_Omsk

Install the coffee-script-source gem.
'application' should not be changed to 'default'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question