SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Zealot ricklach's Avatar
    Join Date
    Nov 2004
    Location
    Victoria BC
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What goes Where?

    Please ignore this request - I have solved the problem.

    After playing with autocomplete for several days I am not much further ahead but I do think I see where the problem is. In brief, I fill in a popup form that has an autocomplete. The view is new and so code-wise here is what I have:
    Code:
     def new
        @eda_officer = EdaOfficer.new
        
      end
      
      def auto_complete_for_voter_lastname
        value = @params[:voter][:lastname]
        @voters = Voter.find(:all,
          :conditions => ['LOWER(lastname) LIKE ?', "#{value.downcase}%" ],
          :order => 'name ASC',
          :limit => 10)
          #@voters = Voter.find(1)
        render :partial => 'officers'
      end
    The new method gets the basic parameters that I need but the auto_complete... never delivers the @voters array. So the question is can I combine the two under new (and how is that done) or am I barking up the wrong tree. I just don't seem to be able to grasp the concept here.

    Rick
    Last edited by ricklach; Apr 4, 2006 at 18:44.
    Ruby, Ruby when will you be mine


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •