Jean Nibee
2007-Sep-11 21:17 UTC
Rendering a partial (through Ajax) and it''s ''hanging''...
Hi I have some HTML code for form that submits a name and I find that name in the database and ''preview'' the info. In the console and from tailling the logs the player is being returned. When it start to render my partial, via a call to an .rjs it just hangs forever. Some Code: <% form_remote_tag :url => { :controller => :rhp_draft, :action => :get_player } do %> Player to Draft: <%= text_field_with_auto_complete :nhl_stat, :player_name %> <%= submit_tag "Preview player" %> <% end %> <br/><hr width=75%/> <div id="player_summary"> Player summary.... </div> *** NOTE: The Autocomplete stuff works..... it''s once I click "preview player" that I have my issues. Controller code: def get_player search = params[:nhl_stat][:player_name] @player = NhlStat.find_by_player_name( search ) end RJS template and Partial that it''s using. get_player.rjs page.replace_html( "player_summary", :partial => "nhl_player", :object => @player ) _nhl_player.rhtml <p> Name: <%= @player.player_name %> Team: <%= @player.team %> Pos: <%= @player.pos %> Salary: <%= @player.salary %> </p> Message from firebug and my log files. Firebug: Looking at the Inspect tag / Console I see that the post information is stuck on "loading..." Log files: Processing RhpDraftController#get_player (for 127.0.0.1 at 2007-09-11 17:09:44) [POST] Session ID: 537556154e6fdc2eed1cb4265c922dec Parameters: {"commit"=>"Preview player", "action"=>"get_player", "nhl_stat"=>{"player_name"=>"John Erskine"}, "controller"=>"rhp_draft"} NhlStat Columns (0.019004) SHOW FIELDS FROM nhl_stats NhlStat Load (0.003660) SELECT * FROM nhl_stats WHERE (nhl_stats.`player_name` = ''John Erskine'') LIMIT 1 Rendering rhp_draft/get_player Notice the last line.. it just hangs there. Any help would be appreciated. Thanks! -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Shandy Nantz
2007-Sep-11 21:23 UTC
Re: Rendering a partial (through Ajax) and it''s ''hanging''...
Just a quick observation, in your form helper: <% form_remote_tag :url => { :controller => :rhp_draft, :action => :get_player } do %> You don''t have the ..... do -%>. That "-" character has given me grief in the past. Just a small observation but sometimes it is the little things that cause all the problems. ~S -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jean Nibee
2007-Sep-11 23:52 UTC
Re: Rendering a partial (through Ajax) and it''s ''hanging''...
Shandy Nantz wrote:> Just a quick observation, in your form helper: > > <% form_remote_tag :url => { :controller => :rhp_draft, :action => > :get_player } do %> > > You don''t have the ..... do -%>. That "-" character has given me grief > in the past. Just a small observation but sometimes it is the little > things that cause all the problems. > > ~SI"ll add it, but I thought that the little - char was only to prevent a linefeed after / before the tag. -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jean Nibee
2007-Sep-11 23:53 UTC
Re: Rendering a partial (through Ajax) and it''s ''hanging''...
Jean Nibee wrote:> > I"ll add it, but I thought that the little - char was only to prevent a > linefeed after / before the tag.added it and no change, still hangs. -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jean Nibee
2007-Sep-12 00:25 UTC
Re: Rendering a partial (through Ajax) and it''s ''hanging''...
Jean Nibee wrote:> Jean Nibee wrote: >> >> I"ll add it, but I thought that the little - char was only to prevent a >> linefeed after / before the tag. > > added it and no change, still hangs.Found the problem... (Rails ''nuances'' are starting to slowly get to me) THIS DOES NOT WORK!! (As I posted above) <% form_remote_tag :url => { :controller => :rhp_draft, :action => :get_player } do %> Player to Draft: <%= text_field_with_auto_complete :nhl_stat, :player_name %> <%= submit_tag "Preview player" %> <% end %> <br/><hr width=75%/> <div id="player_summary"> Player summary.... </div> THIS DOES!! <% form_remote_tag :url => { :controller => :rhp_draft, :action => :get_player } do %> Player to Draft: <%= text_field_with_auto_complete :nhl_stat, :player_name %> <%= submit_tag "Preview player" %> <% end %> <br/><hr width=75%/> <div id="player_summary"> Player summary.... </div> The diff... no line feed after the "do %> Player to Draft" piece of code in the html form being submitted. If I put the text on the following line, the render action hang forever. Double You, Tee, Eff. :) -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gordon
2007-Sep-12 11:21 UTC
Re: Rendering a partial (through Ajax) and it''s ''hanging''...
Hi, It is great you got your code to work, but experience suggests that you did not fix the real problem. While Rails idiosyncrasies have gotten to me, it is highly unlikely that changing the second line to be after the first is the issue. What has helped me before is to delete the first two lines and retype them. You might have a special character lurking. Gordon> > THIS DOES!! > <% form_remote_tag :url => { :controller => :rhp_draft, :action => > :get_player } do %> Player to Draft: <%= text_field_with_auto_complete > :nhl_stat, > :player_name %> <%= submit_tag "Preview player" %> > <% end %> > <br/><hr width=75%/> > <div id="player_summary"> > Player summary.... > </div> > > The diff... no line feed after the "do %> Player to Draft" piece of code > in the html form being submitted. > > If I put the text on the following line, the render action hang forever. > > Double You, Tee, Eff. > > :) > > -- > Posted viahttp://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
pcrawfor
2007-Sep-12 15:16 UTC
Re: Rendering a partial (through Ajax) and it''s ''hanging''...
Just an additional suggestion for debugging this kind of thing, since it is an asynchronous request you don''t see what is really happening in the dev log. But if you run firebug in firefox you will be able to see the ajax request being made in the debugging console and will most likely be able to see what error message is coming back. Paul On Sep 12, 4:21 am, gordon <erleb...-ZsLQZatIiLWVc3sceRu5cw@public.gmane.org> wrote:> Hi, > > It is great you got your code to work, but experience suggests that > you did not > fix the real problem. While Rails idiosyncrasies have gotten to me, it > is > highly unlikely that changing the second line to be after the first is > the issue. > What has helped me before is to delete the first two lines and retype > them. > You might have a special character lurking. > > Gordon > > > > > THIS DOES!! > > <% form_remote_tag :url => { :controller => :rhp_draft, :action => > > :get_player } do %> Player to Draft: <%= text_field_with_auto_complete > > :nhl_stat, > > :player_name %> <%= submit_tag "Preview player" %> > > <% end %> > > <br/><hr width=75%/> > > <div id="player_summary"> > > Player summary.... > > </div> > > > The diff... no line feed after the "do %> Player to Draft" piece of code > > in the html form being submitted. > > > If I put the text on the following line, the render action hang forever. > > > Double You, Tee, Eff. > > > :) > > > -- > > Posted viahttp://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---