<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sergey Mell on Medium]]></title>
        <description><![CDATA[Stories by Sergey Mell on Medium]]></description>
        <link>https://medium.com/@sergey.mell?source=rss-943f3a358b82------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TFG6dR5q61mpA99AeZA7sg.png</url>
            <title>Stories by Sergey Mell on Medium</title>
            <link>https://medium.com/@sergey.mell?source=rss-943f3a358b82------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:10:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sergey.mell/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Easily done infinite image gallery]]></title>
            <link>https://medium.com/@sergey.mell/easily-done-infinite-image-gallery-6f7c93d6fbd1?source=rss-943f3a358b82------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f7c93d6fbd1</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[image-gallery]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sergey Mell]]></dc:creator>
            <pubDate>Sun, 01 May 2022 13:59:45 GMT</pubDate>
            <atom:updated>2022-05-01T17:32:40.015Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQpIszFVwIhEy33Vf0eBaw.jpeg" /></figure><p><em>Image galleries are widely used in many modern websites. They can be implemented in many different ways and there exist plenty of ready-to-use libraries. In this article, I’d like to show one more approach that allows creating an infinite image gallery in an easy manner.</em></p><p>The markup of the gallery is pretty simple. A list of images within a flexbox container. Depending on your design requirements the markup could be more complex, however, the main idea behind remains the same.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd95e04e828d4815ed83054226772d12/href">https://medium.com/media/bd95e04e828d4815ed83054226772d12/href</a></iframe><p>As we are done with the markup, let me present the main idea — when moving forward we will take the last node and put it at the beginning and vice versa when moving backward.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c6f79d9a51fde638de4ac27671778d5/href">https://medium.com/media/6c6f79d9a51fde638de4ac27671778d5/href</a></iframe><p>Below you can find an example and check that the gallery works on a basic level</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fjsfiddle.net%2FSergey_Mell%2Fbtgszn1q%2Fembedded%2F&amp;display_name=jsFiddle&amp;url=https%3A%2F%2Fjsfiddle.net%2FSergey_Mell%2Fbtgszn1q%2F&amp;image=https%3A%2F%2Fwww.gravatar.com%2Favatar%2Fd0590067547388e4abab81343ad5b989%3Fs%3D80&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=jsfiddle" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b94fc689e2a6b983ce04801d667ff98/href">https://medium.com/media/8b94fc689e2a6b983ce04801d667ff98/href</a></iframe><p>However, we usually want galleries to be cute and fancy so let’s add some CSS classes with animations. But we have a problem. If we add some class to the gallery element the animations will be applied only for the first time. This is not what we actually want. We want the animations to be applied each time when we click “next” or “previous” buttons. So we need to find a way to apply and remove the CSS class each time. But, if we just remove and add a CSS class it won’t work</p><pre>item.classList.remove(&#39;animated&#39;);<br>item.classList.add(&#39;animated&#39;);</pre><p>Of course, we can use some kind of timeout but in this case, we have to harmonize their values with animation duration and handle situations when the user clicks faster. So, I think I have a better idea. We can trigger the browser reflow by simply calling the element offset width, for example, between removing and adding the CSS class so the animations will be restarted.</p><pre>item.classList.remove(&#39;animated&#39;);<br>void item.offsetWidth;<br>item.classList.add(&#39;animated&#39;);</pre><p>So the final implementation may look like this</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fjsfiddle.net%2FSergey_Mell%2Fe4bkohLz%2Fembedded%2F&amp;display_name=jsFiddle&amp;url=https%3A%2F%2Fjsfiddle.net%2FSergey_Mell%2Fe4bkohLz%2F&amp;image=https%3A%2F%2Fwww.gravatar.com%2Favatar%2Fd0590067547388e4abab81343ad5b989%3Fs%3D80&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=jsfiddle" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/a26470ba75a34c2969df1102479ccfe5/href">https://medium.com/media/a26470ba75a34c2969df1102479ccfe5/href</a></iframe><p>So, at this point, we are done. I hope you will find useful the above image gallery example. Looking forward to getting your comments and discussions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f7c93d6fbd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TypeORM joined tables in AdminBro back office]]></title>
            <link>https://medium.com/@sergey.mell/typeorm-joined-tables-in-adminbro-back-office-8463bed880c4?source=rss-943f3a358b82------2</link>
            <guid isPermaLink="false">https://medium.com/p/8463bed880c4</guid>
            <category><![CDATA[join]]></category>
            <category><![CDATA[adminbro]]></category>
            <category><![CDATA[table]]></category>
            <category><![CDATA[typeorm]]></category>
            <dc:creator><![CDATA[Sergey Mell]]></dc:creator>
            <pubDate>Thu, 17 Sep 2020 22:42:33 GMT</pubDate>
            <atom:updated>2020-09-17T22:42:33.700Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JuJVNsQWNPqEVYmPraoR_Q.png" /></figure><p><em>In this short tutorial, I will show some particular qualities of rendering joined tables data in the AdminBro back-office while using TypeORM.</em></p><h3>Introduction</h3><p>I would not think of my Medium account as a full-fledged blog but more like some work note pad. So every issue which took me more than an hour of googling for the solution hints I consider as worth to be highlighted here as some helpful instructions for the future and for other developers. Recently I’ve got a very simple task like <strong>showing information from two joined tables as a single list</strong> in the <a href="https://adminbro.com/">AdminBro</a> (v3.2.5) back-office. I used <a href="https://typeorm.io/">TypeORM</a> (v0.2.25) for my model representation and the task looked like a very simple one. However, I faced several pitfalls that I would like to tell you about.</p><h3>Problem with the keys</h3><p>If to reduce the database structure to a minimal reproducible example it will look as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irqLLb_sIzU1_nkcMHzQVw.png" /><figcaption><strong>Simplified database structure</strong></figcaption></figure><p>Consequently, I had two entities that I connected to the back-office (pay attention to non-common column names form the primary columns — pk_post and pk_user as well as the join column).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsAfL633phCKsEGhOfujHA.png" /><figcaption><strong>User and Post entities</strong></figcaption></figure><p>However, the result of the Posts the list looked a bit different from the one I expected to get. Instead of having some link to the post related user which meant correct joining result, I got only the column with foreign key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VW1vrQYO11WjwWoR9wA5Hw.png" /><figcaption><strong>The first result of the posts table with joined users</strong></figcaption></figure><p>However, all the filters worked as expected. That was a bit strange. After some time of debugging and googling, I finally found an answer with the help of <a href="https://join.slack.com/t/adminbro/shared_invite/zt-djsqxxpz-_YCS8UMtQ9Ade6DPuLR7Zw">AdminBro community</a> and <em>Wojciech</em><strong><em> </em></strong><em>Krysiak</em> personally. The problem appears if the primary key column is not called id. I don’t know if this is an issue of the admin panel itself or a TypeORM adapter — I’m going to research it further and make a fixing pull request. However, for now, <strong>the primary column of the entity should always be named </strong><strong>id</strong> like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3f863dba3077b69d6b41c55733dd257/href">https://medium.com/media/e3f863dba3077b69d6b41c55733dd257/href</a></iframe><p>If we do this, everything works as expected and we get the correct link to the joined user and its title instead of a foreign key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lIRWonAZCQrSM5MmVejGXg.png" /></figure><h3>Showing other data from the joined table</h3><p>Well then, after the first part is done, I want to add more information from the joined user table (i.e. link) to the list of posts. The only way to implement this is to create a custom component to be used for rendering this data. But first, let’s describe the additional properties in the declaration of Post resource:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b302693b39a569c96847c46bb697187b/href">https://medium.com/media/b302693b39a569c96847c46bb697187b/href</a></iframe><p>The example above declares an additional property userLink which will be shown only in the list of posts by means of a custom component relatively defined in the file ../components/property-item.tsx. As long as AdminBro uses <a href="https://reactjs.org/">ReactJS</a> for the templates the minimal component for solving this task could look as follows (remember to add &quot;jsx&quot;: &quot;react&quot; option to the compilerOptions of your tsconfig.json)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb5d96eb9f238ad3f44d2e989bbd8e19/href">https://medium.com/media/bb5d96eb9f238ad3f44d2e989bbd8e19/href</a></iframe><p>As can be seen from this file and this long chain of properties, the record is populated with joined tables according to the joining column name and through this population, we can access the params of the joined table.</p><h3>Reuseable component</h3><p>On the previous step we could consider our task as done. However, if we have more properties to show we should create more and more components. That’s no good. Let’s make this component more reusable. What do we need for it? We should let the component know what is the name of the populated record and which param we want to render from it.</p><p>This can be easily done by <a href="https://adminbro.com/tutorial-customizing-resources.html">passing custom params to the component</a> from admin resource:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43fcc2eca962f76f5a436d4395602517/href">https://medium.com/media/43fcc2eca962f76f5a436d4395602517/href</a></iframe><p>After that, we just read these params in the component and use them in the rendering</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd68d619ba10f1c50d0274c3996df880/href">https://medium.com/media/dd68d619ba10f1c50d0274c3996df880/href</a></iframe><p>That’s it. And, as you can see, the obtained result looks as we expected. The list of Posts is populated with some additional data from users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ushrjr62reL_8ZH1Bum_gA.png" /><figcaption><strong>List of posts with additional user-related data</strong></figcaption></figure><h3>Afterwords</h3><p>So this is how we managed some joined tables rendering in the AdminBro back-office. I strongly recommend to look through <a href="https://adminbro.com/tutorial-customizing-resources.html">the documentation</a> and discover more options for AdminBro resources customization and much more useful stuff. In my next topic, I’m going to highlight the custom actions because I saw such questions on the <a href="https://adminbro.slack.com/">community channel</a>.</p><p>Feel free to let me know in the comments if any questions appear or which other topics would be interesting for you. Follow me on <a href="https://medium.com/@sergey.mell">Medium</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8463bed880c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup AdminBro for NestJS application]]></title>
            <link>https://itnext.io/setup-adminbro-for-nestjs-application-de5bc12bc3b3?source=rss-943f3a358b82------2</link>
            <guid isPermaLink="false">https://medium.com/p/de5bc12bc3b3</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[adminbro]]></category>
            <category><![CDATA[admin-panel]]></category>
            <dc:creator><![CDATA[Sergey Mell]]></dc:creator>
            <pubDate>Fri, 31 Jul 2020 22:33:07 GMT</pubDate>
            <atom:updated>2020-08-06T17:12:58.359Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PncahZqWklu-JGH2mrritQ.png" /></figure><p><em>In this brief tutorial, I will present how you can add a multifunctional Django inspired admin panel to your NestJS application. You can use this knowledge to build an effective tool for managing different sorts of data in 10 minutes.</em></p><h3><strong>Introduction</strong></h3><p>NestJS is a progressive Node.js framework that allows us to build efficient, reliable, and scalable server-side applications. When we create such an application usually we need a ready-to-use user interface for administrative activities that allows us to manage entities.</p><p>Being working as a ruby-on-rails developer for a long time I used Active Admin plugin for generating administration style interfaces. It abstracts common business application patterns to make it simple for developers to implement beautiful and elegant interfaces with very little effort. This was something I was looking for to use in my NestJS application.</p><p>I strongly believe that <a href="https://nestjs-admin.com/"><strong>nestjs-admin</strong></a> will become such a solution in the nearest future but for now, in my humble opinion, it’s not ready for effective commercial use. So after some research, I’ve discovered <a href="https://adminbro.com/">AdminBro</a> — an auto-generated Admin Panel for Node.js applications which seems to satisfy all my needs. However, from the box, AdminBro provides his plugins only for Express and Hapi frameworks. As long as NestJS is built on top of express.js it should not be too complicated to integrate it.</p><p>So in this brief tutorial, I will present how you can add the AdminBro backoffice to your NestJS application. You can use this knowledge to build an effective tool for managing different sort of data in 10 minutes.</p><h3><strong>Setup the application</strong></h3><p>So let’s get started and create a new project with the Nest CLI</p><pre>npm i -g @nestjs/cli<br>nest new project-name</pre><p>For your comfort this project is published as a <a href="https://github.com/SergeyMell/admin-bro-example"><strong>GitHub repository</strong></a> and each step is marked with a separate tag so you can follow the history of changes or simply pull and examine the final result.</p><p>Well, now let’s add admin bro plugins and dependencies to the project.<br>Install the AdminBro along with the express plugin</p><pre>npm install -S admin-bro admin-bro-expressjs</pre><p>Additionally, we have to add express-formidable package as long as it is a peer dependency of admin-bro-expressjs:</p><pre>npm install -S express express-formidable</pre><p>As long as we have all the dependencies installed let’s create the initialization function. Just create src/admin-panel/admin-panel.plugin.ts file with the following context</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1985a73da37ef66ae98e68a818e6a53/href">https://medium.com/media/a1985a73da37ef66ae98e68a818e6a53/href</a></iframe><p>Having this we can call the initialization function in main.ts like</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98a27b27defba6fdf4510b3da3469fdc/href">https://medium.com/media/98a27b27defba6fdf4510b3da3469fdc/href</a></iframe><p>As easy to understand, the app object is just a wrap over the express.js application so we can apply all the <a href="https://adminbro.com/tutorial-installation-instructions.html">express related part of admin bro documentation</a>.</p><p>Following instruction, we can fulfill the initialization function with the appropriate code and on the first stage it should look as follows</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98ab0c35a3c74002136fe9bedc1322c1/href">https://medium.com/media/98ab0c35a3c74002136fe9bedc1322c1/href</a></iframe><p>Now we should restart the application and after that, if we go to /admin path of the application we can see the inspiring page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GQip7AYD3nvzA1vu" /><figcaption><strong>Empty admin panel dashboard</strong></figcaption></figure><p>Well, we seem to be on the right way and now let’s move to manage our entities.</p><h3><strong>Configure resources</strong></h3><p>Now let’s move on to the main idea of the article — managing entities. Firstly we should add database integration and create some instance i.e. User. I don’t think it’s required to highlight these steps in detail because <a href="https://docs.nestjs.com/techniques/database">NestJS documentation</a> is comprehensive enough so I would emphasis only on some important points.</p><p>For this example I chose TypeORM and did this for two reasons. The first one — as to me it is closer to the “spirit” of NestJS and is more natural in conjunction with it. And the second — AdminBro doesn’t have the TypeORM support from the box so this makes the implementation a bit more tricky.</p><p>After all the manipulations your User entity could look as follows (be sure to inherit from BaseEntity despite the NestJS documentation is missing this)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5de03ca24675cf8a5040e48af13c541e/href">https://medium.com/media/5de03ca24675cf8a5040e48af13c541e/href</a></iframe><p>Since AdminBro does not support TypeORM from the box we will add an unofficial admin-bro-typeorm <a href="https://www.npmjs.com/package/admin-bro-typeorm">package</a></p><pre>npm i -S admin-bro-typeorm</pre><p>and register it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fdcaf15060464ed843f92304faa8345/href">https://medium.com/media/2fdcaf15060464ed843f92304faa8345/href</a></iframe><p>After the admin panel is configured to use an adapter it’s time to create a resource for managing User entity. I prefer to store all the admin resources in src/admin-panel/resources folder with [entity].resource.ts naming convention.</p><p>In the most simple way, your resource could look simply like export default User;. However, in many cases you need to add some extra options, additional actions, and custom components so I prefer to put resources in a more general form</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66b07aad10eddb7f58961c619227a3b4/href">https://medium.com/media/66b07aad10eddb7f58961c619227a3b4/href</a></iframe><p>After we have this done the final remaining thing is to add it to the list of AdminBro resources within resources: [] block of AdminBro constructor.</p><p>Now you can open your admin panel and create a couple of new users for your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNqbGUP0CJo0oQhfSzLA1g.png" /><figcaption><strong>Creating the first user from the admin dashboard</strong></figcaption></figure><h3>Afterwords</h3><p>So this was the very first step on how to setup an admin panel for your NestJS application. I strongly recommend to look through <a href="https://adminbro.com/tutorial-installation-instructions.html">the documentation</a> and discover a great bunch of AdminBro features that include authorization, additional collection, member and bulk actions, custom components, and much more useful stuff.</p><p>Feel free to let me know in the comments if any questions appear or which other topics would be interesting for you. Follow me on <a href="https://medium.com/@sergey.mell">Medium</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de5bc12bc3b3" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/setup-adminbro-for-nestjs-application-de5bc12bc3b3">Setup AdminBro for NestJS application</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rails Application Template for Creating Ruby-on-Rails Apps]]></title>
            <link>https://medium.com/@sergey.mell/rails-application-template-for-creating-ruby-on-rails-apps-ba03e9b74a0a?source=rss-943f3a358b82------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba03e9b74a0a</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Sergey Mell]]></dc:creator>
            <pubDate>Fri, 16 Jun 2017 07:35:10 GMT</pubDate>
            <atom:updated>2017-06-16T07:35:10.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*cVLbAsC_m2dAsKlE.jpeg" /></figure><p>How can you save your time when developing a rails application? The answer is to use application templates you can build on the basis of simple template our team has recently created. We believe it can be really helpful in your every-day development practice.</p><h3>What is Rails Application Template?</h3><p>Rails Application Template is a basic template for creating Ruby-on-Rails applications. It simplifies the development process when starting a new project and saves your time which can be spent more wisely. Thereby, you can omit all the routine actions and skip to the stages that require you to be more creative and apply your professional skills.</p><h3>Advantages:</h3><ul><li><strong>Time saving</strong>. As we’ve already mentioned, our template saves you from unnecessary work and allows to switch your attention to more interesting tasks.</li><li><strong>Easy process of configuring rails gems</strong>. You can easily configure our template to fit your needs and add new gems (below, we’re describing this process in more details).</li><li><strong>Ease of use</strong>. This template is really easy-to-use and can be enhanced for your own requirements in a straightforward manner.</li></ul><h3>How to use</h3><p>First of all, you should download or clone the template. Then set your ruby version and gemset:</p><pre>$ rvm use 2.3.0@myapp --create</pre><p>When it’s done, install rails gem for the gemset:</p><pre>$ gem install rails -v &#39;your_rails_version&#39;</pre><p>Now you’re ready to use our template when creating your application:</p><pre>$ rails new myapp -m /path/to/template/bootstrap.rb</pre><p>That’s all! It was quite easy, right? And now you can enjoy your application!</p><h3>Customization</h3><p>Template uses<em> config.yml</em> file for installing and configuring rails gems and other stuff. Below you can find a list of statements able to help you customize your own template.</p><p><strong>1) </strong>The configuration file consists of several blocks dividing the application generation process into some logic parts.</p><pre>rvm: ... <br>testing: ... <br>documentation: ... <br>deploy: ...</pre><p>2) The main part of each block is gems. So if you want to have more gems in your project just add a new block with a name that corresponds with your appropriate gems block or add your gems to any existing block.</p><pre>testing:   <br>  gems:     <br>    faker: true     <br>    rspec-rails:       <br>      group: test, development     <br>    factory_girl_rails:       <br>      version: ~&gt; 4.8       <br>      group: test, development</pre><p>You can use a true value for a gem that in this case will be added to Gemfile as gem ‘faker’</p><p>You can also pass version and/or group params and they will be used in Gemfile:</p><pre>gem &#39;factory_girl_rails&#39;, &#39;~&gt; 4.8&#39;, group: [:test, :development]</pre><p>3) Each block can run its own runner from runners folder if one exists. There you can put any code you want to execute, i.e.</p><pre>create_file &#39;.ruby-version&#39;, RUBY_VERSION <br>create_file &#39;.ruby-gemset&#39;, app_name <br>file &#39;.rvmrc&#39;, &quot;rvm use #{RUBY_VERSION}@#{app_name}&quot;</pre><p>4) If you want to perform some actions after gem is added, i.e. run rails generate rspec:install, put callback to the runner and it will be executed when you need. By convention, callback name depends on gem name and should look like:</p><pre>&quot;#{your_gem_name.gsub(&#39;-&#39;, &#39;_&#39;)}_callback&quot;</pre><p>So the full configuration for rspec-rails looks like:</p><pre># config.yml <br>testing:  gems:    <br>  rspec-rails:      <br>    group: test, development </pre><pre># runners/testing.rb <br>def rspec_rails_callback  <br>  generate(&#39;rspec:install&#39;) <br>end</pre><p>You can also read our description of this project <a href="https://github.com/agilie/Rails-Application-Template">here</a>.</p><p><em>Originally published at </em><a href="https://agilie.com/en/blog/Rails-Application-Template-for-Creating-Ruby-on-Rails-Apps"><em>agilie.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba03e9b74a0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>