Explain the role of sub directory app/controllers and app/helpers.

  • App/controllers: in this, a web request is made by the user which is handled by the controller. Rails make use of this controller sub directory for finding the controller class.
  • App/helpers: some helper classes are present in the helper sub directory which is used for assisting the view, model and the controller classes present in it.

Controller:
The rails controller works as the main logical centre of the application. With the help of this user, views, and models can interact with each other. Routing of external requests to internal actions is possible. It can handle the URL very well. It helps in regulating helper modules which extends the capabilities of view templates. It also regulates the session which gives user an impression of an on-going interaction with any application.

 

Comments