🔹 General Rails Project Setup Questions

  1. What does the command rails new neo_app do?

    • Creates a new Rails application named neo_app with a default folder structure, Gemfile, and configuration files.

  2. What is the difference between rails new appname and rails new .?

    • rails new appname creates a new folder.

    • rails new . initializes a Rails project in the current directory.

  3. What is the purpose of the Gemfile generated by Rails?

    • Defines Ruby gems required for the project.

    • Managed via bundle install.


🔹 Database Option (-d postgresql)

  1. What does -d postgresql mean in rails new?

    • Configures Rails to use PostgreSQL as the database instead of default SQLite.

  2. How do you configure database credentials in Rails?

    • Inside config/database.yml using environment variables (or Rails credentials).

  3. How do you create the database after setup?

    • rails db:create

  4. What are the advantages of PostgreSQL over SQLite in Rails?

    • Better performance for large apps.

    • Supports advanced features (JSONB, full-text search).

    • Suitable for production.


Comments

Popular posts from this blog

How is the model view controller framework used in ruby on rails?

What are the different filters used in ruby on rails?