Displaying 1 result from an estimated 1 matches for "set_building_id".
2006 Nov 10
3
Move variables from session to ActiveRecord?
...n[:building_id] to ActiveRecord for creation. I''m not sure
whether to use hidden fields or do it all in the model
''before_validation'' - in either case I don''t know how. My attempt
failed with an ''Invalid method error'':
before_validation :set_building_id
def set_building_id
@unit.building_id = session[:building_id]
end
How can I add session variables to insert/create statements?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Go...