Displaying 20 results from an estimated 10000 matches similar to: "question about hashes in views that model a table?"
2006 Aug 10
6
passing hash from controller to view and pluralization?
hi,
i have 2 tables (counties and towns). counties has_many towns and towns
belong_to counties.
now my question:
i thought i would need to do is say @counties = Counties.find(:all).
should that not return to me all counties in the counties table WITH all
towns associated with each county?
in my view i was getting error when doing this
if(counties.has_towns?)
saying undefined has_towns
Problem with non-ascii characters in forms: "incompatible character encodings: UTF-8 and ASCII-8BIT"
2010 Aug 01
3
Problem with non-ascii characters in forms: "incompatible character encodings: UTF-8 and ASCII-8BIT"
Hi
First off, I''m using Ruby 1.9.1p378 and Rails 2.3.8.
I was creating a minimal application to test handling of Norwegian special
characters when I bumped into this strange problem...
I have a simple Car model with fields maker:string and model:string.
For the controller I planned to just have an index action do all the work:
class CarsController < ApplicationController
def index
2006 Mar 22
3
Parent-Child Tables Help
can someone help me with this
i have a table
cars
(
id int
model_id int
make_id int
color_id int
description text
constraint fk_cars_carmake foreign key(make_id) references
carmakes(id),
constraint fk_cars_carmodel foreign key(model_id) references
carmodels(id),
constraint fk_cars_color foreign key(color_id) references colors(id)
)
carmakes
(
id int
carmake varchar
)
carmodels
(
id
2006 Jul 18
5
SQL query question
Hello,
I know it''s off-topic. But I''m sure you are using SQL and can help me ;)
I''ve a table CARS and a table KEYS and a LOCKS table.
CARS
id|name
1|audi
2|ford
3|mazda
4|porsche
...
KEYS
id|car_id|lock_id
1|1|1
2|2|1
3|2|2
4|3|1
5|3|2
6|4|1
7|4|2
8|4|3
...
LOCKS
id|name
1|main
2|spare
3|engine
...
A car can have many keys. Keys are for different locks.
How can I
2008 Mar 09
1
Two sample t-test
Hi,
I want to perform t-test in R for each individual car. Here is what i have.
Is there a way i can test each car?
The original table (test.csv)
Car Tester2 Tester2 Controller1 Controller2
Audi 0.56 0.9 0.5 0.9
Toyota 0.2 0.9 0.9 0.2
Honda 0.5 0.9 0.1 0.5
BMW 0.2 0.3 0.5 0.7
> cars<-read.table("c://test.csv",header=T,sep=",",
+ skip=2,comment.char="")
2008 Jul 08
4
Conditional "link_to" helper function - AYUDAME POR FAVOR
Hello,
I need to write a function that will return a link only if the current
user is the owner. Here is my code...
1. application_helper.rb
2.
3. def link_to_if_owned(owner_id, anchor_text, where_to_go)
4. if current_user.id == owner_id # current user is owner
5. "#{link_to anchor_text, where_to_go}"
6. else
7. anchor
8. end
9. end
And
2009 Mar 30
1
advice for alternative to barchart
hi folks,
I was wondering if anybody could give me some advice. I've created a
stacked barchart, with 'car model' along the x axis, 'number of cars' along
the y axis. There are 45 individuals involved, each of which can own any
number of cars, of any model (eg an individual could own two cars of one
model, and another car of a different model). I've got a legend by the
2007 May 19
3
form question
Suppose I have the following models/migrations:
class Car < ActiveRecord::Base
belongs_to :manufacturer
validates_presence_of :manufacturer
validates_association :manufacturer
end
class CreateCars < ActiveRecord::Migration
def self.up
create_table cars do |t|
t.column :name, :string
t.column :manufacturer_id, :integer
end
end
class Manufacturer <
2006 Jan 13
6
Locating Objects by associated object.properties
I am just getting the hang of this, so forgive me if this is a stupid
question...
- I have two models/tables: Owners and Cars
- Owners may have many cars. Cars have one owner.
- Cars have a property named Color.
Question: how do I get a list of all the Owners who have RED cars?
I want something like this to work:
Owner.find_by_car.color("RED")
Thanks for any help!
--
Posted via
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
2008 Jun 19
6
How to use SQL without a model?
I want to do a SQL query, but I haven''t created a model. For example,
instead of Car.find(:all) I want to be able to use SELECT * from cars. I
don''t have a Car model because this DB was not created with Rails (it''s
from a PHP project).
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2007 Feb 18
1
Help with pair plot
Hi,
I'm trying to create a plot using pair.
Currently I'm doing the following
pairs(~mpg + hp + wt , data=cars, labels = c("Miles per
Gallon","Horsepower","Weight"),pch = c(24,25)[unclass(cars$tr + 1)],
bg = c("red", "green3")[unclass(cars$tr + 1)],panel=panel.smooth)
for the attached dataset. However,instead of using panel.smooth I
2012 Nov 30
3
(no subject)
Hello R usuer,
The code given below superimposes a pie diagram on another plot
containing some points. However, I would like to center the pie
diagram on the xy location on the plot, but not on the center. is
there any way to re-center pic diagram.
Any suggestion or better alternative are highly appreciated.
Thank you in advance for your help.
Regards,
Bibke
library(visualFields)
library(car)
2015 Jul 03
1
dual-booting <- Re: installing Cents os server 7.0
On 7/2/2015 5:22 PM, Warren Young wrote:
> If your car has a DIN 7736 bay, you can easily replace the existing head unit without redesigning the car. This is directly equivalent to repartitioning and installing CentOS alongside Windows.
how many modern cars have DIN mount stereos anymore? almost all have
some weird custom shaped dashboard specific stereo insert. sure, you can
get DIN
2008 Jul 22
2
ActiveRecord Associations issue
Hello all and thank you for reading this message.
I am new to RoR, and ruby too, but i am quite excited about it.
I am developing a RoR project and with active record associations in
the following
manner
# Tables (all tables have only one record)
CREATE TABLE `webcars_development`.`cars` (
`id` int(11) NOT NULL auto_increment,
`model_id` int(11) NOT NULL default ''0'',
2006 Apr 10
4
First time with Rails
Hi this is my first time with Rails and I''m having problems getting it
to work properly. In the Database.yml file I have set up the following -
development:
adapter: mysql
database: cars
username: *****
password: *****
socket: /path/to/your/mysql.sock
host: *****
But, when I launch the controler it says -
NameError in Add_car#index
uninitialized constant Car
Where am I
2015 Feb 03
4
Another Fedora decision
On Tue, Feb 3, 2015 at 1:01 PM, Valeri Galtsev
<galtsev at kicp.uchicago.edu> wrote:
>
>>
>> Yes, computers and the way people access them are pretty much a
>> commodity now. If you are spending time building something exotic for
>> a common purpose, isn't that a waste?
>
> Do I have to take that people who are not sysadmins themselves just hate
> an
2010 Jun 23
2
Analyzing large transition matrix
Let's say you have a dataframe of car trade-ins. For example, each row
contains
oldcar newcar qty
and a typical entry could be
lexus bmw 1
I put the qty column to allow for fleet purchases, where one purchase
may convert multiple cars at once.
I'd like to show what's going on. I could do a histogram of newcar to
show the frequency each type of car is bought. If there
2003 Dec 02
2
: GLIM PROBLEMS
Hi all
I have another GLIM question.
I have been using R as well as Genstat (version 6) in order to fit
GLIM models to the data (displayed below).
The same models are fitted but the answers supplied by the two
packages are not the same.
Why? Can anyone help?
A discription of the data and the type of model/s fitted can be found
below.
Regards
Allan
The
2009 Dec 11
1
Sources for open sourced homework questions for R?
Hi,
I am teaching a one month class in applied statistics and want to
bring my students up to speed in R without devoting much/any lecture
time to R instruction. I think that the best way to do this is to
provide them with a lot of R questions for homework. These questions
would be numerous (there is a lot of material to cover), go from very
simple to somewhat complex, and focus on all the