📜 ⬆️ ⬇️

Layout organization in rails application using rails_ui_kit gem

Where do you usually design pages for integration with rails application? In a separate repository with html files or immediately in rails - in some special place? Do you test layout with long words and texts? Do you test various options for displaying layout elements with long text? I will try to briefly highlight these issues, talking about the rails_ui_kit gem - a small tool for organizing layout in rails applications and how it had to be used in developing real-world production applications.

The idea to write this gem and use it in different projects arose after reading several posts from the hashrocket blog ( "Managing Design Handoffs with the UI Controller" , "The UI Controller, part 2: Faking It" , "The UI Controller, part 3: the UI Helper ” ).

Briefly about the possibilities of heme:


At the moment, heme has a minimum set of helpers , which are most often used in almost every project. Read more about these helpers on the hashrocket blog. You can add the necessary helpers yourself by expanding the UiHelper module, or adding your own to another.
')
As for the list of all layouts, by default, files from app / views / ui are displayed as links. In one of the projects that we had to work on, we modified this list slightly, making it into categories in order to simplify navigation through a large number of layouts. Access to the list of layouts is not closed by default, this must be remembered , for this you can use several methods, so in the game it is left to the taste of the developer.

As an addition, I will give examples of additional helpers that we used in one of the projects:


In general, you can come up with many different helpers, it all depends on the project and the frequency of their use.

In addition to the features described, I would like to mention a few advantages that this tool has given in developing real production-applications:


I would be glad if the rails_uit_kit gem will interest you and come in handy. I will also be happy to receive feedback and ideas for improving the heme.

The repository page is github.com/puffy/rails_ui_kit , here it is written in detail about usage.

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


All Articles