Search by tag: Ruby on Rails

Using Sweet Alert as confirm in Ruby on Rails 6

I think everyone in the web development process was faced with the need to add a confirm dialog when performing some operation on the site. In this article, I want to write how to add and make an attractive confirm dialog in your Rails apps.

In Ruby on Rails, we have a confirm dialog out of the box, it's a very useful feature because you have the opportunity to easily and quickly create confirmation for some action in your site. In default Rails used for this standard JavaScript confirm (you can read about it in the documentation if you doesn't know it)

See more

Saint P RubyConf 2019 — как это было

И так, прошло уже почти 2 недели, с того момента как прошла очередная конференция по любимому языку программирования Ruby в столь же любимом городе, а руки только дошли чтоб написать о впечатлениях. И да, сразу спойлер, впечатления отличные (кто бы сомневался 😅).

See more

Управляем редиректами в одном месте

В последнее время я все больше и больше склоняюсь к тому, что хочется представлять код некоторыми абстракциями и сущностями, которые будут отвечать за логику работы системы, как отделы на предприятии или заводе, так вот, о подбной истории и захотелось написать.

Я думаю многие сталкивались с проблемой, когда при активном развитии проекта, он обрастает всевозможными пристройками, отвечающие за различные бизнес задачи. Через некоторое время, смотришь на это все со стороны и в глаза начинают бросаться дублирующиеся детали, которые вроде на своем месте, но что-то их много.

Для меня в этот раз стал наш App::BaseController.

See more

Rails: Webpack compile once for parallel tests

When we use gem parallel_tests our application in test environment used, for example, 8 parallel processes. But webpacker compiling the same files at the same time in each process. This is bad and can lead to unexpected errors.

Also when assets did not change, we do not want to spend time compiling them.

See more

Setup parallel tests on Semaphore CI

Hi, today I want speak about slow specs. It's very an unpleasant situation when specs run very slowly and spend many time for build (15-20 or more minutes). One way to remedy this situation it's a split specs into groups and running on multiple CPU cores. For this we can use gem parallel_tests.