similar to: model navigation problem with foreign key

Displaying 6 results from an estimated 6 matches similar to: "model navigation problem with foreign key"

2005 Dec 23
5
Newbie question/help 2 tables, ''sync'' cell values
I have to << search for each problems.room_id=rooms.id and do problems.room_no=rooms.room >> HOW? More details: I have the following tables: - a "rooms" table, with fields (id,room,create...) - a "problems" table with fields (id,room_id,room_no, ...) problem.rb has belongs_to :room validates_associated :room and room.rb has validates_length_of :room,
2012 Nov 26
8
why functional test does not get failure?
The test: test "should get new" do get :new, :room_id => @room.name assert_template(:ne) end the template new does not exists but the test does not get failure. Why? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2007 Nov 30
2
Nested resources and _path methods
Hi guys, I was thinking aboiut this for a while: If I have nested resource routes, for example /building/1/floor/2/ room/ 3 (building has_many floors and so on), I have to call the room_path method like this: room_path @room.floor.building, @room.floor, @room IsnĀ“t there a better way to handle nested routes with foreign keys, or can I have this method overwritten somewhere? Greets Jonas
2006 Aug 15
1
serialisation
the case: i have two classes: 1) class Contract < ActiveRecord::Base serialize :addons end 2) class Addon < ActiveRecord::Base end Now i do the following in contract_controller: def create @contract = Contract.new(params[:contract]) @contract.user_id = session[:user_id] @contract.customer_id = params[:customer_id] @contract.pending = 1 @contract.addons = Array.new end def update
2007 Nov 15
2
Trouble using should_receive
I have this code trying to ensure my reset method works. I want to make sure all the participants have their destroy method called. # in my spec for Room r = Room.new(:name => ''bob'') r.save p = Participant.new(:login => ''a'', :password => ''b'', :password_confirmation => ''b'') p.room = r
2008 May 06
10
Best way to implement?
So I''m new to all this Rails stuff and this is probably a database design-related question to, but here it is... Just for learning I''m trying to build a little real estate listings application. Of course there is the listings model which will store basic information like name, price, description, and all that jazz. I''m to the point where I want to figure out how to