Answer the question
In order to leave comments, you need to log in
What is magic in Ruby on Rails?
Hi people !
I can’t understand what is the “magic” in RoR, which, as it were, is nowhere else!
For example, they don’t say about Django that there is “magic” there, I roughly understand meta programming in RoR, I looked at examples and at least I have an idea about it, but “magic” is a mystery to me, for example, generators in Rails can be called “magic” ?
Answer the question
In order to leave comments, you need to log in
Rails automatically does a lot of the work for you. You just created a controller. And you have access to certain variables, methods, other classes in it. You didn't define or import them yourself in your code. The controller method returned something, the rails themselves will find which view to render. No need to write yourself where it lies and what it is called. It just works like magic. This is convenient, allows you to write less code. But if you do not understand how these tricks work, then problems will arise sooner or later.
The magic is the framework, for example, you create a controller inheriting from ApplicationControler, as a result, you have a lot of things working out of the box, but if something breaks, then you need to understand a huge amount of code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question