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 %>
*** 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
Name: <%= @player.player_name %> Team: <%= @player.team %> Pos: <%= @player.pos %> Salary: <%= @player.salary %>
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!