I hve a relationship like this in my model:
Student
has_one :student_fail
StudentFail
belongs_to :student_fail_state
belongs_to :student
StudentFailState
has_many :students, :through => :student_fail
has_many :student_fails
In terms of the controller, what would be the best way to update
attributes to the student_fails table?
Here’s the view stuff:
resources_form_helper.rb:
def render_form_collection_field(form, name, label = nil, size = nil)
render_form_field(form, name, label) do
params = yield
form.collection_select name, params[:collection],
params[:value_method],params[:text_method], {}, {:size => size}
end
end
def render_form_field(form, name, label=nil)
label ||= name.to_s.gsub(/id$/, ‘’).gsub(’’, ’ ')
label_class = “error” if error_fields.include?(name.to_sym)
<<END_HTML
Any suggestions on how to update other tables from a dropdown menu?
Thanks.