Newbie - a few questions


#1

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


#2

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.

  1. 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).

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

Yes.

  1. 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/