Forum: Ruby on Rails How to connect mysql whit Ruby..

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F49587b49fb884d572818f69bdca826f?d=identicon&s=25 Marco (Guest)
on 2007-03-25 14:58
(Received via mailing list)
Hi !

I am a newbie !

I want to use scaffold !

I dont know if I undestand everything right !

1) create table in mysql (I use mysql query browser)

2) set config/database.yml
  adapter: mysql
  database: hms
  username: root
  socket: /var/run/mysqld/mysqld.sock

3)  rails ruby script/generate scaffold  link Admin


tulap@Yumi:~/rails/howmanystep$ ruby script/generate scaffold  linkP
      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/link_p.rb
   identical    test/unit/link_p_test.rb
   identical    test/fixtures/link_ps.yml
       error  Before updating scaffolding from new DB schema, try
creating a table for your model (LinkP)

Where is my error ?

Thanks !!!

34a7615f38496a5dafbb3e6b721c435e?d=identicon&s=25 Mohit Sindhwani (Guest)
on 2007-03-25 15:06
(Received via mailing list)
Marco wrote:
> 2) set config/database.yml
> 3)  rails ruby script/generate scaffold  link Admin
>   dependency  model
> Where is my error ?
> Thanks !!!
> M.

Hi Marco,

You need to create a model and a table for it before you can generate a
scaffold for it.  I would recommend that you follow one of the many
online tutorials for Ruby on Rails.  Do let us know if you have trouble
finding a good one - I think there's one called Rollin on Rails on but I don't have the link handy - Google should be able to
find it for you.

F49587b49fb884d572818f69bdca826f?d=identicon&s=25 Marco (Guest)
on 2007-03-25 16:34
(Received via mailing list)
I am still follow the book ..

But I doesnt undestand the file /sql/create.sql

This is the model ?

how to create this from phpmysql or from mysql query browser?

B609dc8cf73079db56b3979205e37753?d=identicon&s=25 Rod (Guest)
on 2007-03-25 20:12
(Received via mailing list)
On Mar 25, 8:32 am, "Marco" <> wrote:
> I am still follow the book ..
> But I doesnt undestand the file /sql/create.sql

Hi, Marco.

If by the book you mean Agile Web Dev, you should get the second
edition or read up on migrations -- it's a much more elegant and
useful way to create your db than using .sql files.

That said, could you post the error messages you get when you try to
import the .sql file and the contents of the file?  Perhaps there's a
typo that new eyes will spot.
This topic is locked and can not be replied to.