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 ? ########application.js#################### //= require jquery //= require jquery-ui //= require jquery_ujs //= require_tree . 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 $(''#query'').autocomplete(); Q3 When i include <%= javascript_include_tag :defaults %> i am getting error below one "NetworkError: 404 Not Found - http://localhost:3000/assets/defaults.js" Thanks Fahim Babar Patel -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/YwNCZ9-oKgsJ. For more options, visit https://groups.google.com/groups/opt_out.
Jim Ruther Nill
2012-Nov-26 23:53 UTC
Re: jquery-ujs has already been loaded!(application.js)
Sent from my iPhone On 26/11/2012, at 11:58 PM, Fahim Patel <pafahim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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> > ########application.js#################### > //= require jquery > //= require jquery-ui > //= require jquery_ujs > //= require_tree .What gem provides jquery-ui? It may already be loading ujs. You can look at this gem of you want to use jquery ui https://github.com/joliss/jquery-ui-rails> > 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 functionIf you''re having the error above, other js wont probably run.> > > $(''#query'').autocomplete(); > > > > > Q3 When i include <%= javascript_include_tag :defaults %> i am getting error below one > "NetworkError: 404 Not Found - http://localhost:3000/assets/defaults.js" >Replace :defaults with ''application''> Thanks > > Fahim Babar Patel > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/YwNCZ9-oKgsJ. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, November 27, 2012 5:23:48 AM UTC+5:30, jim wrote:> > > > Sent from my iPhone > > On 26/11/2012, at 11:58 PM, Fahim Patel <paf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> > wrote: > > 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 > > > ########application.js#################### > //= require jquery > //= require jquery-ui > //= require jquery_ujs > //= require_tree . > > > What gem provides jquery-ui? It may already be loading ujs. You can look > at this gem of you want to use jquery ui > https://github.com/joliss/jquery-ui-rails >In dummy project i do //= require jquery_ujs in app.js and there is no error message shown.> > > 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. > > > $(''#query'').autocomplete(); > > > > > Q3 When i include <%= javascript_include_tag :defaults %> i am getting > error below one > > "NetworkError: 404 Not Found - http://localhost:3000/assets/defaults.js" > > > Replace :defaults with ''application'' >I include <%= javascript_include_tag :defaults %> in one of dummy project and there is no error is showing in console. Did i am missing any thing which create problem in javascript files?> Thanks > > > Fahim Babar Patel > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:> > . > To unsubscribe from this group, send email to > rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/YwNCZ9-oKgsJ. > For more options, visit https://groups.google.com/groups/opt_out. > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/6SDefAelKkgJ. For more options, visit https://groups.google.com/groups/opt_out.
Jim Ruther Nill
2012-Nov-27 05:38 UTC
Re: jquery-ujs has already been loaded!(application.js)
On Tue, Nov 27, 2012 at 12:56 PM, Fahim Patel <pafahim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Tuesday, November 27, 2012 5:23:48 AM UTC+5:30, jim wrote: > >> >> >> Sent from my iPhone >> >> On 26/11/2012, at 11:58 PM, Fahim Patel <paf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> 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 >> >> >> ########application.js########**############ >> //= require jquery >> //= require jquery-ui >> //= require jquery_ujs >> //= require_tree . >> >> >> What gem provides jquery-ui? It may already be loading ujs. You can look >> at this gem of you want to use jquery ui >> https://github.com/joliss/**jquery-ui-rails<https://github.com/joliss/jquery-ui-rails> >> > 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?> >> >> 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. >> >> >> $(''#query'').autocomplete(); >> >> >> >> >> Q3 When i include <%= javascript_include_tag :defaults %> i am getting >> error below one >> >> "NetworkError: 404 Not Found - http://localhost:3000/assets/**defaults.js <http://localhost:3000/assets/defaults.js>" >> >> >> Replace :defaults with ''application'' >> > > I include <%= javascript_include_tag :defaults %> in one of dummy project > and there is no error is showing in console. > > 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> Thanks >> >> >> Fahim Babar Patel >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonra...@googlegroups.**com. >> To unsubscribe from this group, send email to rubyonrails-ta...@** >> googlegroups.com. >> >> To view this discussion on the web visit https://groups.google.com/d/** >> msg/rubyonrails-talk/-/YwNCZ9-**oKgsJ<https://groups.google.com/d/msg/rubyonrails-talk/-/YwNCZ9-oKgsJ> >> . >> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >> . >> >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/6SDefAelKkgJ. > > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, November 27, 2012 11:09:11 AM UTC+5:30, jim wrote:> > > > > On Tue, Nov 27, 2012 at 12:56 PM, Fahim Patel <paf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<javascript:> > > wrote: > >> >> >> On Tuesday, November 27, 2012 5:23:48 AM UTC+5:30, jim wrote: >> >>> >>> >>> Sent from my iPhone >>> >>> On 26/11/2012, at 11:58 PM, Fahim Patel <paf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>> 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 >>> >>> >>> ########application.js########**############ >>> //= require jquery >>> //= require jquery-ui >>> //= require jquery_ujs >>> //= require_tree . >>> >>> >>> What gem provides jquery-ui? It may already be loading ujs. You can >>> look at this gem of you want to use jquery ui >>> https://github.com/joliss/**jquery-ui-rails<https://github.com/joliss/jquery-ui-rails> >>> >> 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? >Its application.js .> > >> >>> >>> 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. >>> >>> >>> $(''#query'').autocomplete(); >>> >>> >>> >>> >>> Q3 When i include <%= javascript_include_tag :defaults %> i am getting >>> error below one >>> >>> "NetworkError: 404 Not Found - http://localhost:3000/assets/**defaults.js <http://localhost:3000/assets/defaults.js>" >>> >>> >>> Replace :defaults with ''application'' >>> >> >> I include <%= javascript_include_tag :defaults %> in one of dummy >> project and there is no error is showing in console. >> >> 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 NetworkError: 404 Not Found - http://localhost:3000/assets/**defaults.js <http://localhost:3000/assets/defaults.js>" Thanks>>> >>> >>> Fahim Babar Patel >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby on Rails: Talk" group. >>> To post to this group, send email to rubyonra...@googlegroups.**com. >>> To unsubscribe from this group, send email to rubyonrails-ta...@** >>> googlegroups.com. >>> >>> To view this discussion on the web visit https://groups.google.com/d/** >>> msg/rubyonrails-talk/-/YwNCZ9-**oKgsJ<https://groups.google.com/d/msg/rubyonrails-talk/-/YwNCZ9-oKgsJ> >>> . >>> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>> . >>> >>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:> >> . >> To unsubscribe from this group, send email to >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-talk/-/6SDefAelKkgJ. >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/WB_U96FJLKgJ. For more options, visit https://groups.google.com/groups/opt_out.
On Monday, November 26, 2012 9:28:23 PM UTC+5:30, Fahim Patel wrote:> > 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 ? > > ########application.js#################### > //= require jquery > //= require jquery-ui > //= require jquery_ujs > //= require_tree . > > 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 > > > $(''#query'').autocomplete(); > > > Q3 When i include <%= javascript_include_tag :defaults %> i am getting > error below one > > "NetworkError: 404 Not Found - http://localhost:3000/assets/defaults.js" > > > Thanks > > > Fahim Babar Patel > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/7NNQCyB79V8J. For more options, visit https://groups.google.com/groups/opt_out.