I have two models:

BuildingObject < ActiveRecord::Base
  has_one: object_card

  def base_price_date
    self.object_card.base_price_date
  end
end

ObjectCard < ActiveRecord::Base
  belongs_to: object_card
end

On create/update a building object I need to set only year from
base_price_date. So When I create/update a building_object I have a subform
to input object card values
I have defined base_price_date_form_column with :discard_month => true in
ObjectCardsHelper, in Building Object update/create form nothing happens -
all 3 fields for day, month, year. When I define this method in
BuildingObjectsHelper:
def base_price_date_form_column(record, input_name)
    date_select record, :base_price_date, :name => input_name,
      :start_year => 1990, :end_year => Time.now.year, :discard_month =>
true
  end
there are one field for year only, but the request on submitting is:
"record"=>{"base_price_date(3i)"=>"6", "name"=>" Очистные сооружения в пос.
Новобурейский мощностью до 3200 м3/сут. В составе зоны затопления Бурейской
ГЭС - Реконструкция очистных сооружений п. Новобурейский. II очередь",
"fcp_subprogram"=>"", "dcp"=>"", "object_card"=>{"power"=>"", "id"=>"61",
"cost_in_base_prices"=>"1 000 000.0"}, "dcp_subprogram"=>"", "fcp"=>"2",
"base_price_date(1i)"=>"1993", "base_price_date(2i)"=>"4"}}
So base_price_date in record, not in object_card - so nothing is happened.
There is no update of base_price_date field in ObjectCard.

P.S. in ApplicationController
helper :all is commented

-- 
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