Displaying 2 results from an estimated 2 matches for "pricecode".
2006 Aug 09
2
has_many through delete issue
I have the following many-to-many relationships defined in my model code
to model a many to many relationship between Media and PriceCode with
Price being the association table:
class Media < ActiveRecord::Base
has_many :prices
has_many :price_codes, :through => :prices
end
class Price < ActiveRecord::Base
belongs_to :media
belongs_to :price_code
end
class PriceCode < ActiveRecord::Base
has_many :prices
has_many...
2006 Aug 09
2
how to access selected value in controller action
I have this in a view:
<%= start_form_tag :action => ''create_price'', :id => @media.id %>
<%= select("media", "price_code_id", PriceCode.find_all.collect {|pc|
[pc.name, pc.id ] }, { :include_blank => false }) %>
<%= submit_tag ''Add Price Code'' %>
<%= end_form_tag %>
My question is, how would I access the selected value in the
create_price action in the media controller?
--
Posted via http:...