Hi,
I would like to scope a search with a dropdown. I have a table called
items, which has a column item_type.
In the items controller
active_scaffold :items do |config|
...
config.list.columns = [:item_type, .. ]
config.columns[:item_type].search_ui = :select
....
end
def self.condition_for_item_type_column(column, value, like_pattern)
case value
when 'REQ - CONST'
["#{column.search_sql} = 'REQ - CONST"]
when 'ISSUE'
["#{column.search_sql} 'ISSUE' "]
end
end
In the items_helper
def item_type_search_column(record, input_name)
select :record, :item_type, options_for_select(Item.find
(:all, :select => 'distinct item_type', :order => 'item_type').collect
(&:item_type)), {:include_blank => as_('- select -')}, :name =>
input_name
end
I do not get a select (drop down) box to render with the search box.
Any suggestions greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---