search for: foriegn_key

Displaying 3 results from an estimated 3 matches for "foriegn_key".

Did you mean: foreign_key
2006 Mar 13
7
Problem with params
I''ve got a User model, which holds the following (excerpt): def try_to_authenticate User.authenticate(self.username, self.password) end .. private def self.hash_password(password) Digest::SHA1.hexdigest(password) end def self.authenticate(username, password) @user = User.find(:all, :conditions => ["username = ? AND password = ?",
2006 Mar 22
0
Another Problem with params
...ot;Cache-Control"=>"no-cache"} On 3/22/06, Liquid <has.sox@gmail.com> wrote: > > Hi, > > In your model you could explicitly state the relationship > > class Student < ActionRecord::Base > belongs_to :department, :class_name="department", :foriegn_key => ''department_id'' > end > > Then in the veiw use > <%= text_field "student", "department_id" %> > > or similar for a select box. > > I had similar problems when I was trying to get a form working and found that by doing this it...
2006 Jul 17
6
3 newbie questions
hey all, I have 3 tables like this: Images (id,name) Tags (id,name) ImagesTags(imageid,tagid) in my image model I do a "has_and_belongs_to_many :tags" but to make it work I need to rename ImagesTags(imageid,tagid) to Images_Tags(image_id,tag_id). My question is that given that I can''t rename the table, is there any way to make it work with the original names? Second question: