Hi ,
I am facing one problem , when i require //= require jquery_ujs in app.js than i
am getting error in console.
Q1. What is use jquery_ujs.js ?We have already included jquery.js than why we
need jquery_ujs.js ?
It is needed so that links that have remote: true and is not a get
request will include the authenticity token when you click it. Search
for jquery_ujs
What gem provides jquery-ui? It may already be loading ujs. You can
look at this gem of you want to use jquery ui
getting error in firebug console shown below:-
Error: jquery-ujs has already been loaded!
throw new Error( msg );
Q2. I am using jquery autocomplete and i getting error
TypeError: $(…).autocomplete is not a function
If you’re having the error above, other js wont probably run.
In dummy project i do //= require jquery_ujs in app.js and there is no
error message shown.
In this case, I’m not sure what’s wrong. when you say app.js, do you
mean
application.js? Or do
you have another js file by the name of app.js?
I’m also not sure about this one. Newly generated projects dont use the
:default directive (do you call it a directive?).
They use ‘application’ which is the reason why I told you to change it
to
‘application’ because it is trying to load default.js
To post to this group, send email to rubyonra…@googlegroups.**com.
On Tuesday, November 27, 2012 11:09:11 AM UTC+5:30, jim wrote:
Q1. What is use jquery_ujs.js ?We have already included jquery.js than
//= require jquery-ui
In this case, I’m not sure what’s wrong. when you say app.js, do you mean
application.js? Or do
you have another js file by the name of app.js?
Its application.js .
Q2. I am using jquery autocomplete and i getting error
Q3 When i include <%= javascript_include_tag :defaults %> i am getting
Did i am missing any thing which create problem in javascript files?
I’m also not sure about this one. Newly generated projects dont use the
:default directive (do you call it a directive?).
They use ‘application’ which is the reason why I told you to change it to
‘application’ because it is trying to load default.js
yes , i include :default from my side for testing it whether it give
error
in console or not ?
And there is no error in dummy project.
But when i include in my previous app it give same error