[Rails] Re: Newbie Join-Model Misery

2008-12-29 Thread Ad Richards
Perfect! Works like a charm! A big thanks to all! If anyone is interested the finished app can be downloaded from: http://github.com/aglasspool/rubygrade/tree/master or there is an online demo at http://rubygrade.heroku.com Thanks again! -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Frederick Cheung
On Sep 24, 11:38 pm, Ad Richards [EMAIL PROTECTED] wrote: Okay thanks, I have tried the following in my gradations controller; def create       [EMAIL PROTECTED] = Assignment.new(params[:assignment])       [EMAIL PROTECTED] = Gradation.new(params[:gradation]) But it doesn't seem to

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Ad Richards
Thanks fred, The problem with creating gradations separately when students complete assignments, is that I am then left with no fields in my view in which to enter grades. My plan was to have it so that when an assignment was created, a corresponding grade field would be created for each

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Frederick Cheung
On 25 Sep 2008, at 11:17, Ad Richards wrote: Thanks fred, The problem with creating gradations separately when students complete assignments, is that I am then left with no fields in my view in which to enter grades. My plan was to have it so that when an assignment was created, a

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Ad Richards
Oh that's a good point, I didn't consider that. What do you mean by working around the editing stuff? Do you mean like including an if, else somewhere in the view. i.e: if a grade already exists for a student and assignment then show it, otherwise create a new one (with a default value).?? --

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Ar Chron
Ad Richards wrote: I have got as far as making it so that a grade field is automatically created for each new assignment: def create @assignment = Assignment.new(params[:assignment]) @gradation = @assignment.gradations.build(params[:gradation]) But I don't know how to pass the

[Rails] Re: Newbie Join-Model Misery

2008-09-24 Thread Ad Richards
Everything is now working and I am able to edit the grades inline using super inplace controls from http://os.flvorful.com/super_in_place_controls. However, I have realised that when I create a new assignment a corresponding field for the grade is not automatically created in the join model.

[Rails] Re: Newbie Join-Model Misery

2008-09-24 Thread Ad Richards
How does the new assignment know which students it applies to? I assume that there is something else (like a Course) that the assignment belongs to, to which the students are related as well... When you create a new assignment for a course, that action should be the one to walk the

[Rails] Re: Newbie Join-Model Misery

2008-09-16 Thread Frederick Cheung
On 16 Sep 2008, at 19:34, Ad Richards wrote: Being a rails newbie, I appear to have hit a large wall. I am trying to create an online gradebook using rails, where I and other teachers at my school can record students' grades for all their homework assignments. students