Displaying 7 results from an estimated 7 matches for "room_id".
2006 Jul 13
1
model navigation problem with foreign key
...ines", :integer, :limit => 8, :default => 0, :null =>
false
t.column "created_at", :datetime
end
and another in migration like this
def self.up
create_table :line_msgs do |t|
t.column :sender_nick, :string
t.column :content, :string
t.column :room_id, :integer, :null => false
t.column :send_at, :timestamp
end
execute "alter table line_msgs
add constraint fk_line_msg_rooms
foreign key (room_id) references ac_rooms(id)"
end
and i added the belongs_to :ac_room in line_msg....
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
a...
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 rubyonrails-talk-/JYPx...
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?
...to handle number of
bedrooms, garages, heat/air, and stuff like that. I''d like to present
those as dropdowns with options in the admin and then of course show
the value when viewing the listing.
So how do I do it? I see that I could extend my listings model out to
have something like bedroom_id in it and then have another model
called Bedroom and it have a value column in it. That works fine to
show my dropdown. I think I might need to be using some join table
for these kind of things, but I don''t know enough about it I guess.
Can somebody help me out?
--~--~---------~--~----~...