Displaying 20 results from an estimated 400 matches similar to: "Nested resources and _path methods"
2006 Nov 10
3
Move variables from session to ActiveRecord?
Buildings have units. Units have rooms. Rooms have people. I can grab
building, room, and people IDs and store them in a session[:variable].
However, when creating a new unit, I need to give that
session[:building_id] to ActiveRecord for creation. I''m not sure
whether to use hidden fields or do it all in the model
''before_validation'' - in either case I
2006 Jul 13
1
model navigation problem with foreign key
Hi,
I have a table like this in schema.rb
create_table "ac_rooms", :force => true do |t|
t.column "roomname", :string, :limit => 50, :default => "", :null =>
false
t.column "updated", :float, :default => 0.0, :null => false
t.column "lines", :integer, :limit => 8, :default => 0, :null =>
false
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
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,
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
2013 Jan 25
5
Loop question?
Dear All
I have the following data (somewhat simplyfied):
TINF <-1
a <-c(500,750,1000,1250,1500,1750,2000)
b <-c(8,12,18,24,36,48,60,72,96)
following function:
infcprodessa <-function (D, tin, tau, ts)
(D * (1 - exp(-0.048 * tin))/(tin * (0.048*79) * (1 - exp(-0.048 * tau)))) * exp(-0.048 * (ts - tin))
z <-sapply(1:1, function(n) infcprodessa(1000,TINF,12,12-TINF))
is
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
2009 Jan 18
5
Modeling complex associations
Hi,
Is there any default way to model something like the following
situation in ActiveRecord?:
A company has_many :buildings which are associated to :company, e.g.
in a polymorphic way.
Moreover one and only one of the buildings is the company''s
headquarter.
Thinking in terms of the database, I''d prefer to add an owning
association, an thus have a has_many :buildings plus a
2008 Aug 26
2
[ANNOUNCE] Samba 3.3.0pre1 Available for Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Release Announcements
=====================
This is the first preview release of Samba 3.3.0. This is *not*
intended for production environments and is designed for testing
purposes only. Please report any defects via the Samba bug reporting
system at https://bugzilla.samba.org/.
Major enhancements in Samba 3.3.0 include:
2008 Aug 26
2
[ANNOUNCE] Samba 3.3.0pre1 Available for Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Release Announcements
=====================
This is the first preview release of Samba 3.3.0. This is *not*
intended for production environments and is designed for testing
purposes only. Please report any defects via the Samba bug reporting
system at https://bugzilla.samba.org/.
Major enhancements in Samba 3.3.0 include:
2013 Mar 14
4
exec resource not refreshed when subscribed resource changes
Hello,
I''ve created a little class which should unpack a 7z archive on Windows.
The class has a parameter for passing in the archive version, so that I can
trigger an update when a new version of the archive is available. A
simplyfied version looks like this (requires 7z):
class my_archive ($version = undef) {
file { ''version'':
path =>
2002 Oct 07
2
FireWall Effects on Samba (Newbie)
Dear List,
I have been wrestling with getting Samba 2.2.5 on Redhat 7.1 working on a Windows NT network containing W2K, W98 and Mac machines. I can see the Samba server (gargoyle) from the Win machines fine, but cannot browse any shares (Network unreachable error message). This seems a relatively common problem, but seems harder to resovle in my case :-)
I have walked through the toubleshooting
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
2006 Feb 27
3
bindAsEventListener with parameters
I would like to share a modification to bindAsEventListener() that
might be useful to some of you. It makes it possible to do
function show(event, number) {
alert(Event.element(event).id + " = " + number);
}
Event.observe("el1", "click", show.bindAsEventListener(this, 5);
Event.observe("el2", "click", show.bindAsEventListener(this, 10);
That
2018 Mar 30
2
debian lintian warn: hardening-no-fortify-functions
Hello,
to build + packages dovecot I use the usual Debian tool chain. That includes build with selected GCC options and running lintian.
I notice since a long time (read: many earlier versions, up to 2.2.35) this lintian warnings:
I: dovecot-core: hardening-no-fortify-functions usr/lib/dovecot/auth
N:
N: This package provides an ELF binary that lacks the use of fortified libc
N:
2009 May 04
1
Patches for NUT 2.2.2: APC SmartUPS-900
2009/5/3 Thomas Juerges
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Arnaud,
>
Hi Thomas,
> I just checked the 2.4.1 version of nut and found that you forgot to add
> my old UPS model (APC Smart-UPS 900). I guess it is because you were
> busy at the time when I sent you the patch. So here it goes again. :)
>
uh, right sorry.
I was pretty sure I applied
2009 Feb 25
9
local variables in partials lead to NameError
I know I must be doing something dumb, but I can''t seem to send a
local variable to my partial. The below code leads to the following
error:
NameError in Residential_listings#new
undefined local variable or method `foo'' for #<ActionView::Base:
0x3fb53f8>
I am trying to call the variable ''foo'' in a partial called
_attachment.html.erb, which is nested in
2009 Mar 07
3
Question on Variables
Hi everyone,
Im quite new to R an I have the following Question:
I would like to define Variables which I can add and multiply etc. and that
R can simplyfy the terms.
The variables should stand for integers.
For example I would like to have an entry in an array with variable z
and if I add b+z the field should now contain 2z+b. Or if the field
contains 1 and I add z
2005 Dec 23
0
Problem with large join table and ActiveRecord
Hello,
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
2006 Nov 04
0
Problems with ActiveRecord, Oracle adapter, find_by_sql, multi-table join - ORA-04043 error
Hi all,
Windows XP
Oracle 10g client
OCI8 0.1.16
Ruby 1.8.5
Rails 1.1.6
I''m hitting weird behavior with the Oracle adapter and a find_by_sql
call on a multi-table join.
The SQL looks like this:
SELECT DISTINCT e1.ip_address, loc.street, loc.city, loc.state
FROM schema.net_element ne, schema.equipment e1, schema.equipment e2,
schema.building b, schema.cust_loc cl, schema.location