Forum: Ruby on Rails autocomplete on edit

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8133ee52ca72188132b5c7d97dfb967f?d=identicon&s=25 Chris Habgood (chabgood)
on 2009-03-03 02:11
(Received via mailing list)
Is the normal autocomplete supposed to pull from the DB what is in the
field when doing an edit or is there something else that needs to be
done to get it to show up while doing an edit?
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2009-03-03 05:45
(Received via mailing list)
On Mon, Mar 2, 2009 at 7:10 PM, Me <chabgood@gmail.com> wrote:
>
> Is the normal autocomplete supposed to pull from the DB what is in the
> field when doing an edit or is there something else that needs to be
> done to get it to show up while doing an edit?

I provide a Javascript array, using this method:

def users_list
  @users = User.find( :all, :order => 'username' )
  headers[' content-type' ] = ' text/javascript'
  render :action => 'users_list', :layout => false
end

and this view:

var users = new Array(<%= @users.size %>);
<% @users.each_with_index do |user, index| -%>
users[<%= index %>] = '<%= user.username %>';
<% end -%>



--
Greg Donald
http://destiney.com/
This topic is locked and can not be replied to.