0

I am having a very weird problem that just came up and my guess it's that it may be easy to solve, I just can't seem to figure out.

in my layout/application.html.haml, I have the following:

= javascript_include_tag :all

Rather than RoR translating this to a lot of script-loading lines, it does the following:

<script src="/beta/assets/all.js" type="text/javascript"></script>

similarly, with defaults I get:

<script src="/beta/assets/defaults.js" type="text/javascript"></script>

What should I look for? or what I am missing?

Thanks!

2 Answers 2

1

if you're using the asset pipeline you should add

<%= javascript_include_tag "application" %>

and in your application.js add your required js files

Sign up to request clarification or add additional context in comments.

1 Comment

Hi @Andrei S, Thanks for the reply, I do have a line like that and my application.js has the following: //= require jquery //= require jquery-ui //= require jquery_ujs //= require announcements //= require twitter/bootstrap // //= require_tree . Which includes all of the files I want to load, but I don't see them been loaded in my html source. Ultimately my tabs from bootstrap don't work anymore, but they used to work fine before :s Do you have any idea?
0

The :all option in Rails 3.1 is deprecated.

Instead, you should do something like:

<%= javascript_include_tag "application" %>

And in your application.js add the js file you want to load. require_tree . will add all the js file in the same directory with application.js.

//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require_tree .

1 Comment

Hi @xdazz, Now I get it...I did upgrade to 3.2 and it broke from there. However, I did try to do this method and it didn't work. most likely, the problem lies somewhere else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.