开发者

form_tag , form_remote_tag - action not being called

In my new Team form, user can select players, from a select listbox, to associate with team and can also create new players. Clicking on the 'New Player' button opens a popup form with the following code

When i use the form tag (see below), clicking on the submit button uses the correct action.

<%= form_tag(:controller => "teams", :action => "createPlayers") do %>
<label>Player Name:</label> <%= text_field_tag(:name, nil) %></span>
<%= submit_tag("Create New Player") %>

However am planning on using ajax to update the select list for players. When i use 'form_remote_tag' instead of 'form_tag' and i click on the submit button, the 'createPlayers' action is not called. In fact nothing happens..

I would be grateful if someone can tell me why using 'form_remote_tag' does not call the 'createPlayers' action when the submit button is pres开发者_运维百科sed.

Many many thanks for any suggestion provided.

Cheers


<% form_remote_tag :url => { :controller => 'xyz', :action => :you method } do %> 
<%=text_field_tag : %>
<%= submit_tag "" %> 
<% end %> 
something like that
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜