I am running on Rails 2.2.2 on Solaris (and also on my mac) against
mysql. For some reason, when I use a select in the partial, the
database does not get updated with the changed value. I am using
checkbox for other fields which works perfectly.
I can provide more information if needed, but I would like the field
to work as a dropdown instead of a text field.
My Model:
has_and_belongs_to_many :industries, :join_table =>
“grant_loans_industry”, :foreign_key =>
“grant_loans_id”, :association_foreign_key => “industry_id”
belongs_to :state
My Controller:
before_filter :login_required
layout “admin”
active_scaffold :grant_loan do |config|
config.list.columns = [:agency, :gov_type, :title, :url]
config.columns.exclude :state_name
config.label = ‘Grants and Loans’
columns[:state].form_ui = :select
columns[:industries].form_ui = :select
end
Partial:
<%= select :grant_loan, :business_type, [‘for_profit’,‘non_profit’],
{:selected => @record.business_type, :prompt => “Select The Business
Type”}, {} %>