开发者

form_remote_tag select_tag parameter not passed

I have problem with my form_remote_tag. it did not pass the parameters.Have been trying solutions from the net and from the ones here, but to no avail.

<%=form_remote_tag(:url=> {:action=>"showteam"},:update=>"display_div") do -%>   

          <tr>
            <th colspan="2" scope="col">Choose team&nbsp;&nbsp; &nbsp;&nbsp; </th>
          </tr>
          <tr>
            <td align="center">
            <%=select_tag ('team_id',options_for_select(@teams.collect{|t| [t.name,t.id]}))%>
           </td>

           <td><%=submit_tag "Show"%> </td>           
           </td>
          </tr>                   
         </table>
        <%=end_form_tag%>

        <div id="display_div"></div>

that is my list.rhtml view. Here's my controller.

def showteam      

  @team = params[:team_id]
  $logger.info("#{Time.now} Received rm12 >> #{@team.inspect} &g开发者_开发知识库t;> #{params[:team_id]} #{session[:user_name]} ")
  render(:layout => false)

end

SO from the controller, i get nil value for @team.inspect. is it the .rhtml file?must i do partial? Thank u.


OK i think i have solved the problem.

It is indeed because of the HTML table tags. It seems that they have certain order for my codes to work eg so that the params are being passed.

here's the link for more details.

Thank u for those who tries to help. ;)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜