Home / Interview / Rails :: General Questions

Interview :: Rails

21) The string can be represented in single as well as double quotes. What is the difference between the two?

The single quote string representation is not allowed to perform string interpolation and process the ASCII escape codes.

22)

Explain rails migration?

With the help of rails migration, Ruby can make changes to the database schema.

23) How would you create a controller for the subject?

You have to use the following command to create a controller for subject:

24)

Explain view in Rails?

View represent data in a particular format in an application for the users. This subsystem is implemented in ActionView library. This library is an Embedded Ruby (Erb) based system which define presentation templates for data presentation.

25)

Explain the controller in Rails?

The Controller directs traffic to views and models. This subsystem is implemented in ActionController library. This library is a data broker sitting between ActiveRecord and ActionView.

26)

Explain RVM in Rails?

RVM stands for Ruby Version Manager. It is a command line tool which allows you to install, manage and work with different Ruby environments efficiently. With RVM, you can easily install different versions of Ruby and quickly switch between them.

Syntax:

The basic syntax of RVM is,

27)

What are Gemsets in Rails?

Gems in Ruby are used to extend capabilities of core Ruby distribution. They add specific functionalities in programs. Some gems are also installed with Ruby installation to provide specific environments are called gemsets. You can have different versions of the same gem installed in a system.

To know all the gems available in Ruby, use the following command:

28)

Write the command to update RVM in Rails?

To upgrade RVM, use the following command:

29)

Explain bundler in Rails?

Rails bundler provides a constant environment for applications by tracking suitable gems that are needed.

To use bundler, use the following command:

30)

Why we use migration in Rails?

Migration alters the database schema for an application in a consistent and organized manner by using DSL.

Syntax to create a migration file: