Displaying 4 results from an estimated 4 matches for "norian".
Did you mean:
dorian
2007 Dec 04
5
when to save, session reflect saves?
I am trying to clean up unnecessary lines (even as I hack my way forward
adding more garbage)
I have two questions on lines I have trying to keep the database and
session info reflecting changes:
def associate_pupil_to_teacher
@teacher = session[:teacher]
@pupil = Pupil.find(params[:id])
@teacher.pupils << @pupil
@teacher.save #Q1
session[:teacher] = @teacher #Q2
end
#Q1 do i
2007 Nov 28
5
methods in models dont work for views?
This question is more towards understanding how things work rather than
trying to just get something to work.
I have something like this in my user model.
def full_name
first_name + " " + last_name
end
This works find if I use it for display values in a
collection_for_select.
options_from_collection_for_select( @users, :id, :full_name)
It displays the full name in the
2007 Dec 07
4
capitalizing an attribute - view, controller, or model?
The users will enter students names on forms. How do I intercept the
first and last names and have them stored capitalized when the user
inputs them in lower case?
Do I mess with the form html, skipping form_for helpers and using
conditional clauses in the view?
Do I need to separate out the individual attribute and update it
separately in the controller actions that save/updates the
2007 Dec 04
0
a new model object associated with two parents
Please excuse me if I am asking too many questions. I''ve been
appreciating the help (and I have been learning from reading other
peoples questions and answers too)
Here is a cooked up example of a basic idea I am trying to accomplish
Say that I have a Pupil model . Perhaps also a Teacher, Course models.
Teachers will have things called Course_Offerings. To keep track of a
pupils