Displaying 20 results from an estimated 4000 matches similar to: "Rails day 2: where is my association?"
2006 Sep 29
1
newbie Q: it won't display foreign keys...
I have two tables
CREATE TABLE continents (
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE countries (
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL,
continent_id int(11) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I generate scaffolds for country and for
2006 Jan 29
6
tyro Ruby questin
Trying to print out a simple database grid, using, with column headers
such as ''SunToSatRoles'', ''PrimaryRoles'', etcetera.
Iterating through an object @List which is populated thusly
@list = mymodel.find(:all, :order => mymodel.editlist_order)
When I do something like
<table>
<% for i in @list %>
<tr>
<td><%= i.inspect
2006 Feb 14
0
rubyforge-0.1.1
SIMPLIFY SHARING YOUR RUBYGEMS ON RUBYFORGE!
~> gem install rubyforge
SYNOPSIS
rubyforge [options]* mode [mode_args]*
DESCRIPTION
simplistic script which automates a limited set of rubyforge operations
MODES
setup()
initializes your .rubyforge directory. you need to run this first before
doing anything else.
example :
rubyforge setup
login()
2006 Mar 21
3
Newbie - ActiveRecord relationships
So I''ve worked through Agile Web Development with Rails and I''m now
trying my first little app to get into the swing of things. Its a task
tracking app where people can create tasks and assign them to others,
and also log time against the tasks.
I''m having trouble working out the model relationships. This is what
I''ve got so far, but its not right as
2008 Aug 07
2
Cannot link mypackage to 2 other packages
Hi,
I need to link mypackage to 2 other packages so I can call
some C functions defined in these 2 packages from mine.
I've tried
Depends: packageA, packageB
LinkingTo: packageA, packageB
as suggested by the "5.4 Registering native routines" section
of the "Writing R Extensions" manual but then only packageA is
seen at compilation time (gcc is called with
2006 May 30
3
Help about CMS - newbie in RoR
Hi team, I''m a very newbie RoR user from Spain and I''m developing a
blog''s CMS. Why RoR?, coz I think it''s an amazing framework with many
posibilities, portable and really powerful, with a young and optimist
community, and taking my project I''ve prefered his structure in front of
LAMP. Another thing is that I''ve liked to surprise my masters
2006 Aug 02
2
many-to-one relationship, do I need a second table?
Ok, to keep things short. Im wondering if I need a secondary
relationship table to handle my many-to-one relationships. Here is an
example of what I''ve written down. For instance say I want to find all
of the people in a given location.
class Location < AR:Base
has_many :people
end
class Person < AR:Base
belongs_to :location
end
My SQL tables look like:
CREATE TABLE
2013 Jan 27
1
How to remove packages from the active working window
Hi all mailing listers,
My question is as follows:
e.g.
I launched two packages, say packageA and packageB, but they have the
function of the same name, leading to masking. I want to remove the
packageA from the working window after using the packageA so as not to
causing problem. I do not want to carry out task each time using packageA
and packageB individually because many the tasks share
2013 May 04
0
[PATCH] Downloads section: link to downloads.xiph.org
In downloads.html, link to downloads.xiph.org instead of SourceForge
for source tarballs.
Also includes a minor language fix in developers.html.
---
developers.html | 2 +-
download.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/developers.html b/developers.html
index 149b6b5..87f0a9a 100644
--- a/developers.html
+++ b/developers.html
@@ -47,7 +47,7 @@
2006 Jul 15
1
Relationship problem, newbie problem, need help!!
Hey all
I seem to be having some problems with my relationship between a few
tables...
If i then run the following query in mysql, i get the data i want. How
do i do this in rails relationships and models?
select * from shop_addresses
left join shops on shops.id = shop_addresses.shop_id
left join styles on styles.id = shops.style_id
where shop_uri = ''127.0.0.1''
Cheers!!
2008 Dec 22
2
batch mode hangs if dest is uptodate
I have been using batch mode successfully. I try this using cygwin on a
PC with 3.0.4 version of rsync. The two PackageOlder dirs are identical
cygwin> diff -r /home/bill/tmp/PackageB /home/bill/PackageB
cygwin> rsync -vv --only-write-batch=/Temp/changeAtoB.rsync -rptO -L
--delete-delay devserver::RT/PackageB/ /home/bill/tmp/PackageA
opening tcp connection to devserver port 873
sending
2006 Aug 18
3
Understanding MVC - view customization after using scaffolds
All,
I have ordered AWDWR and am anxiously awaiting its arrival. In the
meantime I still am playing with ROR using radrails. I have a few
questions ...
I create a table named customers with the following details:
Field Type Null Key Default Extra
id int(11) NO PRI auto_increment
customer_name varchar(50) NO
inbound_retention int(11) NO
outbound_retention int(11) NO
unix_admin_email
2006 Mar 09
4
habtm questions
I''ve got some of this working but other parts are ellusive.
I have
CREATE TABLE `bags` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '''',
PRIMARY KEY (`id`)
CREATE TABLE `packages` (
`id` int(255) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '''',
PRIMARY KEY (`id`)
CREATE TABLE
2006 Apr 27
2
"for column in..." not picking up _id columns
My code executes fully:
<% for column in ModelName.content_columns %>
<th><%= column.human_name %></th>
<% end %>
but it does not pick up any columns in my model''s table that end in
"_id".
Is this by design?
Is there a helper method that will reference the related tables? Or
will I need to code the column titles and detail records by
2006 Mar 22
3
Something wrong with content_columns
I have a database with a couple of tables. One table called spares has
foreign keys in another called equipment. When I create a new record,
it is added to the spares table however the list action does not show
all the columns in the table. It only shows those columns that are not
foreign keys. I am using the default action generated by scaffold for
list.
Why is that so? Do i need to re-write my
2006 Mar 01
1
maddening intermittent failures in unit tests with "working" code
Hi all,
This testing problem has been a sink for time today, and is still unresolved.
Basically I have some unit tests that test simple functions (example below)
that depend on join operations in a habtm relationship, and I suspect I am
getting "false" failures, i.e ones that do not logically make any sense. I
need fresh sets of eyes to take a look and see if I''m mising
2006 Jan 11
3
How do you do a custom sql call in rails?
Hi.
I am developing an industry specific crm that allows busineses to track
customers in a particular way. Each customer will be assigned a customer
number. The first customer will have a customer number of 1, the second
customer_number = 2, etc... Note that this customer number is not global
but particular to the account that created the customer (see schema snip
below).
I need to have a
2006 Feb 28
0
Confusion with counter and single table inheritance
I''m having trouble getting the magical counter to work in a rails app
with single table inheritance.
following is the relevant code.
thank you
class declarations
class Job < ActiveRecord::Base
has_many :vents
end
class Vent < ActiveRecord::Base
belongs_to :job, :counter_cache => true
validates_numericality_of :width
end
class Rectangular < Vent
2007 Oct 19
1
install.packages() and configure.args
Hi,
In the case where install.packages("packageA") also needs to install
required package "packageB", then what is passed thru the 'configure.args'
argument seems to be lost when it's the turn of packageA to be installed
(the last package to get installed).
This is not easy to reproduce but let's say you have the graphviz libraries
installed on your system,
2006 Mar 20
1
FileColumn question
Can someone please help me with this.
I have an Images table :-
create table images (
id integer unsigned not null auto_increment primary key,
image varchar(200) not null default ''''
)ENGINE=InnoDB default CHARSET=latin1;
And a car table :-
create table cars (
id integer unsigned not null auto_increment primary key,
user_id integer unsigned not null,
title varchar(100) not