I am using this example for file uploader and highcharts application in ruby.
In order to get charts work, I had to add following files to my app/assets/javascript:
highcharts.js
jquery-1.4.2.min.js
rais.js
And to my charts.html.erb following code:
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "jquery-1.4.2.min", "rails", "highcharts" %>
<%= csrf_meta_tag %>
My charts look beautiful but I cannot upload the files. There is some kind of a conflict between those javascripts and etc.
I want to move those 3 files to another directory and define a path for the code in charts.html.erb to that it will find where all neccessary files are.
I do not know where to write a defined path in the code.
something like this:
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "public/javascripts/jquery-1.4.2.min", "public/javascripts/rails", "public/javascripts/highcharts" %>
<%= csrf_meta_tag %>
but it tells me an error in a console:
Started GET "/assets/public/javascripts/rails.js" for 127.0.0.1 at 2013-01-15 16:21:19 +0100
Served asset /public/javascripts/rails.js - 404 Not Found (33ms)
ActionController::RoutingError (No route matches [GET] "/assets/public/javascripts/rails.js")
:
Thanks in advance
You don’t need to define each and every javascript file name explicitly in latest rails versions.
This is because of
application.jsfile which requires every js for you in tree form.You just need to do like that –