How can I reuse components and widgets in other Rails applications? Is that a good idea?

I have mini widgets consisting of a model, a controller of several styles and several lines of javascript. Whenever it turns out that I need something like this in the next application that I create, I need to make a copy from the application in which I created them. Needless to say, this is not fun.

So, I heard about component infrastructures such as Cells, Apotomo and Parts that promise to make this work easier, but I could not find any discussions around them or any other important community actions, usage statistics, etc. indicate their acceptance. With the exception of a few blogposts, the community is strangely silent about the components. It makes me think: they are a good idea, and if not, why not?

+3
source share
3 answers

Reusing code from multiple projects as a whole is a good idea. This reduces the need for maintaining several different sets of code and simplifies the rapid implementation of functions.

. , , gem, github, , .

+1

plugin gem Ruby/Rails . , .

+1

Cell usage statistics (since September 2010): https://rubygems.org/gems/cells

0
source

Source: https://habr.com/ru/post/1773797/


All Articles