N
N
nluparev2018-06-16 23:06:01
Ruby on Rails
nluparev, 2018-06-16 23:06:01

Why are Engines needed in Rails?

Why are engines needed? I'm talking about this guides.rubyonrails.org/engines.html
what's the use of them? response to the solution of what problem did they arise?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
blackst0ne, 2018-06-17
@nluparev

Gem is a package for code.
Analogy: a zip-archive, inside of which different things can lie.
As a rule, independent code is packaged inside a gem. It can be used both in your own scripts and in other frameworks. Not necessarily only in rails.
Just connect the gem and use it.
Rails engine is also ruby ​​code. But its main difference from the rest of the gem libraries (which are commonly called gems) is that this code is not independent. It cannot be connected in your script or in some other framework. It will only work in rails, because it contains rail-specific code without a hint of independence.
Think of the engine as a plugin or feature to rails, not as a standalone product.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question