question,option1,option2,option3,option4,answer,difficulty What is Ruby on Rails?,A web application framework,A database management system,A programming language,A web server,A web application framework,low Which command is used to start a new Rails project?,rails new,rails generate,rails start,rails setup,rails new,low What is the purpose of the `Gemfile` in a Rails project?,To list project dependencies,To store database configurations,To manage migrations,To define routes,To list project dependencies,medium What is Active Record in Rails?,A module for managing CSS files,An ORM for database interactions,A JavaScript framework,A library for API creation,An ORM for database interactions,medium How do you create a migration in Rails?,rails generate migration,rails create migration,rails new migration,rails db migration,rails generate migration,medium Which directory in a Rails project contains controller files?,app/controllers,app/models,app/views,config/,app/controllers,low What is the primary use of `routes.rb` in a Rails application?,To define the application's routes,To manage database migrations,To configure environment settings,To define helper methods,To define the application's routes,low Which of the following is NOT a Rails environment?,production,testing,development,staging,testing,medium What does the `rake db:migrate` command do?,Runs pending migrations,Deletes old migrations,Seeds the database,Clears the database cache,Runs pending migrations,medium How do you roll back the last migration in Rails?,rake db:rollback,rake db:reverse,rake db:down,rake db:undo,rake db:rollback,medium What does the `before_action` callback do in Rails?,Executes code before a controller action,Executes code after a controller action,Executes code during a migration,Executes code during deployment,Executes code before a controller action,medium Which of the following is used to render a view in Rails?,render,display,show,view,render,low How do you define a one-to-many association in a Rails model?,has_many,has_one,belongs_to,has_and_belongs_to_many,has_many,medium What does the `flash` object in Rails do?,Stores temporary messages,Handles session data,Manages cookies,Configures routing,Stores temporary messages,medium Which command is used to start the Rails server?,rails server,rails start,rails run,rails execute,rails server,low What is the default database for Rails?,SQLite,PostgreSQL,MySQL,Oracle,SQLite,low How do you create a new controller in Rails?,rails generate controller,rails new controller,rails create controller,rails add controller,rails generate controller,medium What is the purpose of the `schema.rb` file in Rails?,Describes the database schema,Stores routing information,Configures application settings,Manages testing files,Describes the database schema,medium Which helper method is used to generate a link in Rails views?,link_to,url_for,path_to,link_for,link_to,low How do you add a new column to a table in Rails?,rails generate migration AddColumnName,rails db:add_column,rails table:add_column,rails migration add_column,rails generate migration AddColumnName,high