I have Sales and Salespeople:

    class Sale < ActiveRecord::Base
      belongs_to :salesperson
    end

    class Salesperson < ActiveRecord::Base
      has_many :sales
    end

I have field searching switched on and I can successful filter my
sales by salesperson. However I only want to show a subset of
salepeople in the salesperson drop down so I am using a form override:

    def salesperson_form_column(record, input_name)
      select :record, :salesperson,
current_user.office.salespeople.find(:all).collect {|p| [ p.name,
p.id ] }, :name => input_name
    end

This works correctly on the form to create/update sales records,
however it doesn't work on the field searching. The drop-down
correctly appears, but doesn't have any effect. I can pick a
saleperson but the list doesn't filter.


I compared the generated HTML between the standard saleperson drop-
down and my overrideen one nd they do seem to differ slightly:

  <select class="salesperson-input" id="search_salesperson"
name="search[salesperson][id]">

-vs-

  <select class="" id="record_salesperson" name="search
[salesperson]">



Any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to