RoR how does scaffold work?

A

anansi

Hi,
I wanna write a little blog in ruby so I started with creating a
mysql-db with blog_test, blog_development, blog_production. Then I
created a new rails project with "rails blog". I create, in the folder
db, a file create.sql with this content:

drop table if exists entrys;

create table entrys (
id int not null auto_increment,
headline varchar(100) not null,
news text not null,
primary key (id)
);

then I did:
mysql blog_development <db/create.sql
which works without problems. After that I changed /config/database.yml:

development:
adapter: mysql
socket: /var/run/mysqld/mysqld.sock
database: blog_development
username: anansi
password:
host: localhost

test:
adapter: mysql
socket: /var/run/mysqld/mysqld.sock
database: blog_test
username: anansi
password:
host: localhost

production:
adapter: mysql
socket: /var/run/mysqld/mysqld.sock
database: blog_production
username: goldstein
password:
host: localhost

because I needed to update the socketline. But if I wanna now scaffold I
get this error :

ruby script/generate scaffold Entry Admin
exists app/controllers/
exists app/helpers/
exists app/views/admin
exists app/views/layouts/
exists test/functional/
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
identical app/models/entry.rb
identical test/unit/entry_test.rb
identical test/fixtures/entries.yml
error Before updating scaffolding from new DB schema, try
creating a table for your model (Entry)

Can someone tell me what this means? I called the scaffold Entry which
is correctly named for the mysql handling of rails. Why comes this error
and how can I fix it or go around it?

--
greets

(
)
(
/\ .-"""-. /\
//\\/ ,,, \//\\
|/\| ,;;;;;, |/\|
//\\\;-"""-;///\\
// \/ . \/ \\
(| ,-_| \ | / |_-, |)
//`__\.-.-./__`\\
// /.-(() ())-.\ \\
(\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star
 
S

Sammy Larbi

anansi wrote, On 4/30/2007 9:40 AM:
Hi,
I wanna write a little blog in ruby so I started with creating a
mysql-db with blog_test, blog_development, blog_production. Then I
created a new rails project with "rails blog". I create, in the folder
db, a file create.sql with this content:

drop table if exists entrys;

create table entrys (
id int not null auto_increment,
headline varchar(100) not null,
news text not null,
primary key (id)
);

then I did:
mysql blog_development <db/create.sql
which works without problems. After that I changed /config/database.yml:
I think generally, you'll want to use the migrations, as I think that
works some magic on config files which the scaffold command may be
looking for. For more info on migrations, see
http://www.google.com/search?q=ruby+on+rails+migrations
 
A

anansi

you know what my error belongs to?


--
greets

(
)
(
/\ .-"""-. /\
//\\/ ,,, \//\\
|/\| ,;;;;;, |/\|
//\\\;-"""-;///\\
// \/ . \/ \\
(| ,-_| \ | / |_-, |)
//`__\.-.-./__`\\
// /.-(() ())-.\ \\
(\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star
 
D

Damian

anansi said:
drop table if exists entrys;

create table entrys (
id int not null auto_increment,
headline varchar(100) not null,
news text not null,
primary key (id)
);

Hi!

Rails uses English rules for pluralisation, so the table should be named "entries".
If you're unsure about the form you should use, you can always check from
script/console:=> "entries"

Yours sincerely,
Damian/Three-eyed Fish
 
A

anansi

I jackass :) thanks of course this solved my problem

Hi!

Rails uses English rules for pluralisation, so the table should be named
"entries".
If you're unsure about the form you should use, you can always check
from script/console:
=> "entries"

Yours sincerely,
Damian/Three-eyed Fish


--
greets

(
)
(
/\ .-"""-. /\
//\\/ ,,, \//\\
|/\| ,;;;;;, |/\|
//\\\;-"""-;///\\
// \/ . \/ \\
(| ,-_| \ | / |_-, |)
//`__\.-.-./__`\\
// /.-(() ())-.\ \\
(\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star
 
A

anansi

Is there at all any Rails newsgroup?!?

Giles said:
Now this really is a question for the Rails list, not this list.


--
greets

(
)
(
/\ .-"""-. /\
//\\/ ,,, \//\\
|/\| ,;;;;;, |/\|
//\\\;-"""-;///\\
// \/ . \/ \\
(| ,-_| \ | / |_-, |)
//`__\.-.-./__`\\
// /.-(() ())-.\ \\
(\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star
 
A

anansi

what you wanna say with this? there's no info about a rails newsgroup on
this website..

Phillip said:
http://www.rubyonrails.org/community

Just a guess, but checking a project's / software's website usually
yields such information.


--
greets

(
)
(
/\ .-"""-. /\
//\\/ ,,, \//\\
|/\| ,;;;;;, |/\|
//\\\;-"""-;///\\
// \/ . \/ \\
(| ,-_| \ | / |_-, |)
//`__\.-.-./__`\\
// /.-(() ())-.\ \\
(\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star
 
S

Sammy Larbi

Anansi,

They are calling it a "mailing list" rather than a "newsgroup" on the
Rails site.

The link for that mailing list/newsgroup is
http://groups.google.com/group/rubyonrails-talk

You probably will get better answers there, as it is focused
specifically for Rails, while this is general Ruby (though, I don't feel
Rails questions are or should be off topic here.)

Regards,

Sam


anansi wrote, On 5/2/2007 7:00 AM:
 
A

anansi

lol there's a fucking huge difference between a newsgroup and a
mailinglist ;)

Sammy said:
Anansi,

They are calling it a "mailing list" rather than a "newsgroup" on the
Rails site.
The link for that mailing list/newsgroup is
http://groups.google.com/group/rubyonrails-talk

You probably will get better answers there, as it is focused
specifically for Rails, while this is general Ruby (though, I don't feel
Rails questions are or should be off topic here.)

Regards,

Sam


anansi wrote, On 5/2/2007 7:00 AM:


--
greets

(
)
(
/\ .-"""-. /\
//\\/ ,,, \//\\
|/\| ,;;;;;, |/\|
//\\\;-"""-;///\\
// \/ . \/ \\
(| ,-_| \ | / |_-, |)
//`__\.-.-./__`\\
// /.-(() ())-.\ \\
(\ |) '---' (| /)
` (| |) `
jgs \) (/


one must still have chaos in oneself to be able to give birth to a
dancing star
 
S

Sammy Larbi

anansi wrote, On 5/3/2007 9:31 AM:
lol there's a fucking huge difference between a newsgroup and a
mailinglist ;)

It seems to work about the same way this one does... I figured you
might get better (or at least a larger variety of) answers from
something like this (Ruby-Talk), but more focused on Rails, like Rails-Talk.
 
J

James Britt

Logan said:
Well, since this is a mailing list, and you seem only interested in
newsgroups, please kindly go away.


The Curse of the Mirror!

Is it time for the permathread about mirroring the ruby-talk list to
comp.lang and other places?

No?


Good.
 
M

Mariusz Pękala

--MfFXiAuoTsnnDAfZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Is there at all any Rails newsgroup?!?

For quick questions you may want to look at #rubyonrails IRC channel on
irc.freenode.org.

Very helpful.


--=20
No virus found in this outgoing message.
Checked by 'grep -i virus $MESSAGE'
Trust me.

--MfFXiAuoTsnnDAfZ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6-ecc01.6 (GNU/Linux)

iD8DBQFGPv7PsnU0scoWZKARArSBAKCwKcpDxDHIeNwgoIOGWQl6J1q8wACgo/C8
jzbSDGmk+fv+Fag6q5rS1+k=
=Pj8l
-----END PGP SIGNATURE-----

--MfFXiAuoTsnnDAfZ--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top