Answer the question
In order to leave comments, you need to log in
How to change routing effect on coffeescript?
In the config/routes.rb file:
resource :quizzes do
resource :questions
end
Answer the question
In order to leave comments, you need to log in
Look at the "page sources", you will see explicit loading of all your scripts there, because you have such an instruction in application.js //= require_tree . which, roughly speaking, means "insert everything in /assets/javascripts/ into application.html.erb" because in turn you have the following line in application.html.erb
Alternatively, you can remove //= require_tree . from application.js and explicitly specify which scripts need to be loaded by default and for individual pages do this
in /views/layouts/application.html.erb
<head>
...
<%= yield :header %>
...
</head>
<% content_for :header do %>
<%= javascript_include_tag 'quizzes' %>
<% end %>
Because you have a line in application.js
or separately
//= require quizzes
//= require questions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question