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.
Frank R. (Guest)
on 2005-12-01 18: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 R.
removed_email_address@domain.invalid
Rick <> (Guest)
on 2005-12-02 15: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 R.
> removed_email_address@domain.invalid

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