Explain me what is the difference between concern and application_controller.rb in ruby on rails?



Explain me what is the difference between concern and application_controller.rb in ruby on rails?..

Answer / Vimal Kumar

ApplicationController.rb is the base controller for all controllers in a Rails application. It contains common methods shared among controllers, such as authentication or session handling.nnConcerns, on the other hand, are modules that can be included in any model or controller to add specific functionalities without duplicating code. They allow you to share functionality between multiple controllers and models.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

Explain rvm in rails?

1 Answers  


what are benefits of using active record as opposed to raw sql queries?

1 Answers  


How many types of relationships does a model has?

1 Answers  


What is the main function of helpers used in ruby on rails?

1 Answers  


What are generators in ruby on rails?

1 Answers  


what is the function of garbage collection in Ruby on Rails?

1 Answers  


What is the naming convention for variables?

1 Answers  


ruby on rails and java ,which of one of the best in future &present?

1 Answers  


Explain model in rails?

1 Answers  


How is calling super() different from the super call?

1 Answers  


How is direct different from render?

1 Answers  


Explain how Rails implements Ajax?

1 Answers  


Categories