开发者

Error in autocomplete in rails if the name is having spaces in between and multiple auto complete in the same page

HI ,

I am using Auto complete in rails .

My auto complete looks like

          <%= text_field_with_auto_complete User.name, :login, { :size => 15 }, { :url => {:controller => 'users', :action => 'autocomplete_for_supervisors'}, :method => :get, :param_name => 'term'} %>

This generates the fields where

     <input type="text" 开发者_开发问答 size="15" name="Franklin Roosevl[login]" id="Franklin_Roosevl_login">
     <div id="Franklin Roosevl_login_auto_complete" class="auto_complete"></div>

This doesnt allows me to do auto complete . But if my Username is a single name its working perfectly How to solve this issue.


Why are you naming your text field with User.name??

Maybe you should try this:

<%= text_field_with_auto_complete :user, :login, { :size => 15 }, { :url => {:controller => 'users', :action => 'autocomplete_for_supervisors'}, :method => :get, :param_name => 'term'} %>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜