Can someone post a complete AJAX based auto-complete sample code. I have tried the to implement one based on http://script.aculo.us/demos/ajax/autocompleter http://www.bluelightsoft.com/blog/post95_ruby-on-rails-autocompleter-tutoria l.html still not successful. Obviously I am doing something wrong. Would like a good working example to compare with my code. Thanks in advance. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Here is to find a user to assign ACLs:
in views/layouts/application.rhtml
<%= javascript_include_tag ''prototype'',
''effects'', ''controls'' %>
(need to include proper javascript)
in my view (views/zone/edit.rhtml)
User login <%= text_field_with_auto_complete ''user'',
''login'' %>
in my controller (controllers/zone)
def auto_complete_for_user_login
@users = User.find :all, :conditions => ["login like ?",
@params[:user][:login] + ''%''], :limit => 10
render :inline => "<%= auto_complete_result(@users,
''login'') %>"
end
Good luck.
Ananthakrishnan wrote:
> Can someone post a complete AJAX based auto-complete sample code. I
> have tried the to implement one based on
>
>
>
> http://script.aculo.us/demos/ajax/autocompleter
>
>
http://www.bluelightsoft.com/blog/post95_ruby-on-rails-autocompleter-tutorial.html
>
>
>
> still not successful. Obviously I am doing something wrong. Would like
> a good working example to compare with my code.
>
> Thanks in advance.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Rails mailing list
>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
Hi I''ve just put together a post with some sample code: http://www.ccjr.name/blog Cloves Carneiro Jr --- Ananthakrishnan <ananthkrish-zCpon8wu3duE88LZEN7QYV6hYfS7NtTn@public.gmane.org> wrote:> Can someone post a complete AJAX based auto-complete > sample code. I have > tried the to implement one based on > > > > http://script.aculo.us/demos/ajax/autocompleter > >http://www.bluelightsoft.com/blog/post95_ruby-on-rails-autocompleter-tutoria> l.html > > > > still not successful. Obviously I am doing something > wrong. Would like a > good working example to compare with my code. > > Thanks in advance. > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________________________________ Find your next car at http://autos.yahoo.ca
Hi Jos, what if I want to have in my result more than just user.login, what if i want to see his user.nick render :inline => "<%= auto_complete_result(@users, ''login'', ''nick'' ) %>" Jos wrote:> Here is to find a user to assign ACLs: > > in views/layouts/application.rhtml > <%= javascript_include_tag ''prototype'', ''effects'', ''controls'' %> > (need to include proper javascript) > > in my view (views/zone/edit.rhtml) > User login <%= text_field_with_auto_complete ''user'', ''login'' %> > > in my controller (controllers/zone) > def auto_complete_for_user_login > @users = User.find :all, :conditions => ["login like ?", > @params[:user][:login] + ''%''], :limit => 10 > render :inline => "<%= auto_complete_result(@users, ''login'') %>" > end > > Good luck. > > Ananthakrishnan wrote: > >> Can someone post a complete AJAX based auto-complete sample code. I >> have tried the to implement one based on >> >> >> >> http://script.aculo.us/demos/ajax/autocompleter >> >> http://www.bluelightsoft.com/blog/post95_ruby-on-rails-autocompleter-tutorial.html >> >> >> >> >> still not successful. Obviously I am doing something wrong. Would like >> a good working example to compare with my code. >> >> Thanks in advance. >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >>