Lorenzo Brito Morales
2011-Feb-17 20:31 UTC
why javascript is never called in the view index
if i rendered in the controller def index @tips = Tip.all respond_to do |format| format.html # index.html.erb format.js { render :nothing => true } format.xml { render :xml => @tips } end end the complete source, the view index, the index.js.erb and the controller http://pastie.org/1576136 please help -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lorenzo Brito Morales
2011-Feb-17 20:36 UTC
Re: why javascript is never called in the view index
Never rendering Started GET "/tips" for 127.0.0.1 at Thu Feb 17 14:38:15 -0600 2011 Processing by TipsController#index as HTML Tip Load (0.6ms) SELECT `tips`.* FROM `tips` Tiptag Load (0.3ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 37) Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 37) LIMIT 1 Tag Load (0.2ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 3) LIMIT 1 Tiptag Load (0.3ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 48) Tiptag Load (1.0ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 47) LIMIT 1 Tag Load (0.1ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 11) LIMIT 1 Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 48) LIMIT 1 Tag Load (0.1ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 12) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 49) Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 49) LIMIT 1 CACHE (0.0ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 11) LIMIT 1 Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 50) LIMIT 1 CACHE (0.0ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 12) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 50) Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 51) Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 51) LIMIT 1 Tag Load (0.1ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 13) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 52) LIMIT 1 Tag Load (0.2ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 14) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 52) Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 56) LIMIT 1 CACHE (0.0ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 14) LIMIT 1 Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 57) LIMIT 1 Tag Load (0.1ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 19) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 63) Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 64) LIMIT 1 Tag Load (0.1ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 25) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 64) Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 65) LIMIT 1 CACHE (0.0ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 25) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 65) Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 66) LIMIT 1 CACHE (0.0ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 25) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 67) Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 68) LIMIT 1 CACHE (0.0ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 25) LIMIT 1 Tiptag Load (0.2ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.tips_id = 68) Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 69) LIMIT 1 Tag Load (0.1ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 4) LIMIT 1 Tiptag Load (0.1ms) SELECT `tiptags`.* FROM `tiptags` WHERE (`tiptags`.`id` = 70) LIMIT 1 Tag Load (0.1ms) SELECT `tags`.* FROM `tags` WHERE (`tags`.`id` = 9) LIMIT 1 Rendered tips/index.html.erb within layouts/todoform (87.1ms) Completed 200 OK in 99ms (Views: 83.9ms | ActiveRecord: 7.3ms) On Thu, Feb 17, 2011 at 2:31 PM, Lorenzo Brito Morales <lorenzo.brito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> if i rendered in the controller > def index > @tips = Tip.all > > respond_to do |format| > > format.html # index.html.erb > format.js { render :nothing => true } > > format.xml { render :xml => @tips } > end > end > the complete source, the view index, the index.js.erb and the controller > http://pastie.org/1576136 > > please help >-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Feb-17 21:24 UTC
Re: why javascript is never called in the view index
On Feb 17, 8:31 pm, Lorenzo Brito Morales <lorenzo.br...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the complete source, the view index, the index.js.erb and the controllerhttp://pastie.org/1576136 > > please helpWhat''s the question ? I don''t understand from what you''ve written the difference between what you''re getting and what you''re expecting Fred -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lorenzo Brito Morales
2011-Feb-17 21:34 UTC
Re: Re: why javascript is never called in the view index
im expecting thata its gets execute $(document).ready(function(){ alert(''ox''); } in the index.js.erb On Thu, Feb 17, 2011 at 3:24 PM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Feb 17, 8:31 pm, Lorenzo Brito Morales <lorenzo.br...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> the complete source, the view index, the index.js.erb and the controllerhttp://pastie.org/1576136 >> >> please help > > What''s the question ? I don''t understand from what you''ve written the > difference between what you''re getting and what you''re expecting > > Fred > > -- > 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@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jim Ruther Nill
2011-Feb-18 01:03 UTC
Re: Re: why javascript is never called in the view index
the line format.js {render :nothing => true} renders, well, nothing. so it gives a blank page. if you want the action to render the corresponding template, remove the render function. On Fri, Feb 18, 2011 at 5:34 AM, Lorenzo Brito Morales < lorenzo.brito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> im expecting > thata its gets execute > $(document).ready(function(){ > alert(''ox''); > > } > in the index.js.erb > > On Thu, Feb 17, 2011 at 3:24 PM, Frederick Cheung > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On Feb 17, 8:31 pm, Lorenzo Brito Morales <lorenzo.br...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > >> the complete source, the view index, the index.js.erb and the > controllerhttp://pastie.org/1576136 > >> > >> please help > > > > What''s the question ? I don''t understand from what you''ve written the > > difference between what you''re getting and what you''re expecting > > > > Fred > > > > -- > > 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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > -- > 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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lorenzo Brito Morales
2011-Feb-19 04:47 UTC
Re: Re: why javascript is never called in the view index
Thanks, it works, the thing is that i did thing that the _index.js.erb is for put all the javascript,but now i see that i just to work for ajax things, i think it was a way to organize javascrit code. On Thu, Feb 17, 2011 at 7:03 PM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the line > format.js {render :nothing => true} > renders, well, nothing. so it gives a blank page. if you want the action to > render > the corresponding template, remove the render function. > > > On Fri, Feb 18, 2011 at 5:34 AM, Lorenzo Brito Morales > <lorenzo.brito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> im expecting >> thata its gets execute >> $(document).ready(function(){ >> alert(''ox''); >> >> } >> in the index.js.erb >> >> On Thu, Feb 17, 2011 at 3:24 PM, Frederick Cheung >> <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > >> > On Feb 17, 8:31 pm, Lorenzo Brito Morales <lorenzo.br...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> > wrote: >> > >> >> the complete source, the view index, the index.js.erb and the >> >> controllerhttp://pastie.org/1576136 >> >> >> >> please help >> > >> > What''s the question ? I don''t understand from what you''ve written the >> > difference between what you''re getting and what you''re expecting >> > >> > Fred >> > >> > -- >> > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. >> > To unsubscribe from this group, send email to >> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > For more options, visit this group at >> > http://groups.google.com/group/rubyonrails-talk?hl=en. >> > >> > >> >> -- >> 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 this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > ------------------------------------------------------------- > 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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.