search for: people_id

Displaying 8 results from an estimated 8 matches for "people_id".

2006 Feb 20
0
How to reference a field of an associated object in a text_field
...names, addresses, and the classes they want to register. I am trying to uniquely identify the first and last names of the two registrants in my form so that the rails magic will work for filling in the relationships. I saw that for checkboxes, you can do <%= check_box("registration[people_ids][]", "last_name", ..... and that will make rails do the magic to populate the people_ids for each instance of the person and last_name field. It doesn''t seem to work for text fields, e.g. <%= text_field ("registration[people_ids][]", "last_name") %...
2005 Dec 23
0
Problem with large join table and ActiveRecord
...I''m having a hard time explaining this, so I hope i can say this correctly. I have these tables: people id fname lname departments id name buildings id name room wtkeys id key_number key_way Issued_keys id people_id department_id building_id wtkey_id date_issued My question is when i need to insert a new issued_key do I just do something like: person = Person.new person.fname = "Robert" person.lname = "Boone" person.save! dept = Department.new...
2006 Sep 13
1
insert a date like 2006-00-00
Mysql makes possible to insert a date like 2006-00-00. And i want to do that, if my client dont knows the month he puts it to zero. But when i do something like this: fp = ProfessionalFunction.new(:people_id => 5, :start => "2006-12-0") fp.save it puts a NULL value in the start field (type date). suggestions?? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post...
2006 Jul 28
2
has_many :through with multiple paths
...son record could be on 6 different teams at the same time in different roles. the same person could even be on the same team multiple times in different roles. I am not 100% sure how to go about this. I am thinking that I will need something like an intermediate record. teams_people id team_id people_id role I would then have (I think) to have methods in the Team model that will find each person in the @team.people array based on the role. I the end I want a view to have something like: Team Name Manager: Person1, Person 4 Programmer: Person2, Person 3 Designer: Person2 Lackey: Person3 With j...
2007 May 28
5
CTI in ActiveRecord
I search an plugin or gem, but don''t find nothing satisfactory. I believe to be stranger a technology that nails the DRY, have that create you vary equal tables, instead of using inheritance. Exists an soluction for this? I want a solution similar to this: create_table :people |t| do t.column :name t.column :address end create_table :customer |t| do t.column :person_id
2006 Feb 20
0
No Magic for HABTM forms?
...TWO attendees, so the form has entry fields for two people. I wanted the controller to be able to create those two people automatically when it got the form submission. It seemed like the variable names in the form could support that with [] names, for example, text_field("registration[people_ids][]", "first_name" .... But it seems it can''t do that, so I used text_field_tag in the form like so: text_field_tag("registration[people][1][first_name]" ... text_field_tag("registration[people][2][first_name]" ... Then my registration_controller han...
2008 Feb 12
8
has_many through question
I have made 3 tables +------------+ +----------------+ +------------+ |people | |people_campaigns| |campaigns | +------------+ +----------------+ +------------+ |id :int | <----> |people_id :int | /-> |id :int | |name :string| |campaign_id :int| <-/ |name :string| |etc ... | |exported :int | |desc :string| +------------+ +----------------+ +------------+ The people model looks like this has_many :people_campaigns has_many :ca...
2006 Jan 19
5
limits of has_and_belongs_to_many
I''m experimenting with Rails on the Recipes example first before I dive into applying it to my intended application. I''m exploring which will be more work: to rename all the primary id''s in the legacy database, or to work around the fact that the primary id''s are not called ''id'' within RoR instead. I''ve been successful in using a