Displaying 1 result from an estimated 1 matches for "students_url".
2007 Dec 02
3
Better way for select list for belongs_to?
...Student.find(params[:id])
@student.attributes = params[:student]
@student.course = Course.find(params[:student][:course])
respond_to do |format|
if @student.save
flash[:notice] = "#{@student.full_name} was successfully
updated."
format.html { redirect_to students_url }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @student.errors.to_xml }
end
end
end
====================
Students :belongs_to :course, and Course :has_many :students. I''ve
tri...