Forum: Ruby on Rails newbie - a few questions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
998baab37c607466125c1235c1ad7006?d=identicon&s=25 Frank Rocco (frocco)
on 2005-12-01 17:18
(Received via mailing list)
Hello,

I am referrign to the cookbook example.

1. How does rails know when I generate the controller and model for
Recipe
that it needs to read the recipes table?

2. I am using instantRails, how can I change the default MySql localhost
to
use another MySql on another server 10.10.5.x?

3. Can rails do the things I do currently in PHP and JSP? Like login and
exporting to pdf/world

4. How do I validate a field to say it is required?

Thanks for the help.


Regards,

Frank Rocco
farocco@hotmail.com
01ec89b682c7ae076d25c39a70def227?d=identicon&s=25 Rick <willirl@gmail.com> (Guest)
on 2005-12-02 14:30
frocco wrote:
> Hello,
>
> I am referrign to the cookbook example.
>
> 1. How does rails know when I generate the controller and model for
> Recipe
> that it needs to read the recipes table?

It pluralizes the model name.

> 2. I am using instantRails, how can I change the default MySql localhost
> to
> use another MySql on another server 10.10.5.x?

Look in the config/database.yml file for the application.  You specify
the host there (and the database, username, pw).

> 3. Can rails do the things I do currently in PHP and JSP? Like login and
> exporting to pdf/world

Yes.

> 4. How do I validate a field to say it is required?

In the model class.  For example to require field "abc" do this:

   validate_presence_of  :abc

> Thanks for the help.
>
>
> Regards,
>
> Frank Rocco
> farocco@hotmail.com

Here is the Rails API docs:  http://rails.outertrack.com/
This topic is locked and can not be replied to.