<?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 Przemek Bieliński on Medium]]></title>
        <description><![CDATA[Stories by Przemek Bieliński on Medium]]></description>
        <link>https://medium.com/@przemek_86374?source=rss-3ee386ce143e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TE0Gh4rUgsEMSIGfX-pJAg.jpeg</url>
            <title>Stories by Przemek Bieliński on Medium</title>
            <link>https://medium.com/@przemek_86374?source=rss-3ee386ce143e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:39:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@przemek_86374/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[So you want to be a Ruby developer?]]></title>
            <link>https://blog.codequest.com/so-you-want-to-be-a-ruby-developer-17926d30d114?source=rss-3ee386ce143e------2</link>
            <guid isPermaLink="false">https://medium.com/p/17926d30d114</guid>
            <category><![CDATA[recruitment-problems]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[recruiting]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Przemek Bieliński]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 05:31:00 GMT</pubDate>
            <atom:updated>2025-02-28T12:57:20.360Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8FVq3deUltvJmo6qdts5wg.jpeg" /></figure><p>Some time ago I was asked to try and organize the <a href="https://codequest.com/">codequest</a>’s Ruby team into a more cohesive unit, which meant I got to be called a Team Leader (hell yeah!!!), and — more importantly — effectively became the go-to person for all the HR guys trying to recruit new devs (uhm…). Obviously, most of those devs were juniors with a sprinkle of mids. I try to approach every interview remembering that not so long ago I myself have been the aspiring junior sitting on the other side of the desk, so I do my best to be patient, kind and give every candidate an honest and helpful feedback, even if we decide that they need some more experience under their belt to be accepted. However I do see some patterns — a lot of developers, especially juniors, make mistakes that not only make their start harder, but are also quite easy to avoid, if only someone told them that early enough. I have made most of those mistakes myself in my time and it would probably save me a lot of frustration if someone warned me — or maybe they did and I didn’t listen closely enough — so to make someone else’s life easier I will try to point out what a junior dev (or even a mid dev) can do better, if they want to effectively grow as a programmer in a decent software house.</p><p><strong>GitHub</strong></p><p>Everyone in the community knows that your GitHub repository is what really matters for the future employer. Or is it? If you’ve written an open-source library that people use, or contributed to one, yes, it can be a pretty valuable bargaining chip. If you’ve written an app, even if it’s a training app, that solves some everyday problem you have — that can also show your skills. However if all repos you have to show are half-finished recruitment tasks from other companies, not touched once in the last nine months, or super-basic Rails scaffolds from when you wrote your first ‘rails new’, is it really something you want us to see? You might be much better now than you were nine months ago, hell, you probably are, but we don’t know that, and when you send us a link to a code graveyard in your CV — well, as the saying goes, you only have one chance to make a first impression, right?</p><p>And it’s not just junior devs — if you looked in my GitHub repos, you’d find exactly the same kind of all-over-the-place stuff — recruitment tasks from years ago, some abandoned experiments in languages I was learning along the way etc. I commit to GitHub every day — but I commit to private client repos, thus not really having a lot to show for it. What I’m trying to say is: it’s OK to not have a lot going on in your GitHub account — but if that’s the case, don’t use it to show us where you are as a software developer.</p><p><strong>Ruby</strong></p><p>We all love Rails! And we also hate it. And sometimes we love it and hate it at the same time. Or sometimes one day we love it, only to hate it and curse it the next. However we all agree that Rails is the industry standard when it comes to building web applications in Ruby — it takes a lot of dedication and effort to work in this business and not touch it even briefly (even though I’ve met people who claim to have done so!). So it’s only natural that when you decide to become a Ruby web developer, you learn Rails. However, it’s not so good, when you learn Rails without learning Ruby! You might think that it will speed up your progress — after all, setting up a basic Rails app is very easy — but you’ll find very soon that you don’t really understand WHY it works, you’ll only know THAT it works when set up in a certain way, and the first bug you encounter will leave you just sitting there and browsing Stack Overflow looking for someone who’s had a similar problem.</p><p>Think of it this way — you wouldn’t try to write a book in a foreign language using just Google Translate and movie quotes, right? And that’s what writing an application really is — you literally write something that has to make sense, and the better you know the language, the better you can convey the intended meaning, the more efficient you become in putting together sentences — the more sense it makes. When you only know Rails, your vocabulary is very limited and you can really only do one thing. And I can assure you — you don’t want to work in a company that wants someone like that, because very soon you’ll be reduced to a robot that churns out basic CRUD views, which is exciting for, like, two months, but then quickly becomes a programmatic equivalent of brushing your teeth — you have to do this and you do this, but it’s not really something to look forward to, is it?</p><p>I have learned to start every interview with a super simple, basic question:</p><p>- In Ruby, what is a class, what is a module, what’s the difference between them and what are they used for?</p><p>You’d be surprised at how many people don’t actually know that! And these are people who want to be software engineers. They all can set up a Blog with Posts and Comments in minutes — and that’s about it. I’ve had one candidate for a mid dev position, who claimed to have worked for over a year on client’s app as a team lead — and still he didn’t know what a Ruby module is.</p><p>Do not become that person. Learn Ruby. There’s a lot of resources for you to do that. One of the best I know is <a href="https://rubyreferences.github.io/rubyref/">The Ruby Reference </a>— an online book that takes the knowledge from Ruby docs and organizes it into simpler, easy to read format. Read it, learn it, and feel your programming power grow!</p><p><strong>Rails</strong></p><p>Having said the above, let’s not forget that Rails is the Ruby go-to framework when writing a web app. There’s a big chance it will become your everyday basic tool — so take the time to learn how it works! <a href="https://guides.rubyonrails.org/">Rails Guides</a> is a very approachable and quite extensive piece of documentation — take the time to read it and learn it as well. A lot of it will not make much sense to you in the beginning and there are big chunks of stuff in there that you will use very seldom, maybe even never — but just knowing about them gives you a much bigger toolbox for the solutions you’re going to come up with at work.</p><p><strong>Tutorials</strong></p><p>Tutorials are great — everyone uses them! However following someone’s instructions is not enough — remember, the goal of the tutorial is not to end up with a working Blog with Posts and Comments, but to learn how to build your own app. And that is exactly what you should do as soon as possible. Think of all those moments when you thought ‘If only I had an app for this!’. Or maybe ask your friends and family if there is an app that they would use. It can be anything — a simple todo organizer, a present wish-list, really anything. My first app was a kind of notebook for my wife’s experiments in her lab (she’s a scientist and yes, in case you’re doing years math right now, I started programming in my thirties). I never finished it, but it doesn’t matter — in this case it’s about the process, not the result. When doing a tutorial you are dealing with artificial problems and ready-made solutions — when you’re building your own thing you’re forced to really think about how to build it. You have to find solutions to your problems on your own — and I firmly believe that there is no better way of learning how to build things than to actually go out there and start building them, because that’s what you will be doing as a web developer in a software studio. Tackling difficulties will give you an enormous sense of satisfaction, build your confidence and ignite that spark of excitement that drives us to sit for hours hunched over our keyboards just to see a correct JSON or a working registration form. It will give you experience and something to show. Your code does not have to be pretty or flashy — you’re a beginner, nobody expects you to write an operating system! But as a person who recruits juniors, 10 times out of 10 I will choose someone with a piece of programming of their own, even if ugly and lame, over someone who can only show me some paint-by-numbers tutorial apps.</p><p><strong>Mr. Nice Guy</strong></p><p>This last point is something that doesn’t really apply to one specific level of experience, but to essentially everyone who works in our industry. It’s very simple — don’t be an asshole. Be nice to others. Be helpful. Smile. Ask if you don’t know, explain if asked. Don’t look at people down your nose if they don’t know stuff, because every single one of us can be humbled very quickly by someone else at any moment — computer science, programming and IT in general is such a broad field, that it’s virtually impossible to be an expert at everything. Accept that you can learn from anyone, even if they have a fraction of your experience. Teach others, because teaching others is one of the best ways to verify what you really know. And accept that if you’re the smartest person in the room, you should switch rooms, because that’s the only way to grow and not become complacent. Test your knowledge and your skills and leave your comfort zone as often as possible, because as the common weightroom catchprase has it — ‘if it hurts, it’s growing’.</p><p>If you’re also into the front-end stuff, make sure to check out a comprehensive list of <a href="https://medium.com/codequest/common-mistakes-in-junior-front-end-projects-fba37d8917db">most common mistakes of junior front-end developers</a>, by our front-end Team Leader Piotr Kabaciński.</p><p>💌 <strong>You like stories like this? Don’t miss out — </strong><a href="https://medium.com/codequest/newsletters/codequest"><strong>join our newsletter!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17926d30d114" width="1" height="1" alt=""><hr><p><a href="https://blog.codequest.com/so-you-want-to-be-a-ruby-developer-17926d30d114">So you want to be a Ruby developer?</a> was originally published in <a href="https://blog.codequest.com/">codequest</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ActionCable in Rails API]]></title>
            <link>https://blog.codequest.com/actioncable-in-rails-api-f087b65c860d?source=rss-3ee386ce143e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f087b65c860d</guid>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[actioncable]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Przemek Bieliński]]></dc:creator>
            <pubDate>Wed, 07 Feb 2018 12:59:38 GMT</pubDate>
            <atom:updated>2025-02-28T12:58:37.073Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoFm4Hfql66gmTGnk9J44w.png" /><figcaption>by Mareta Mara</figcaption></figure><p>As we all know, <strong>Rails 5</strong> introduced a built-in <strong>WebSockets</strong> handling module called <strong>ActionCable</strong>. It’s a full front and backend package setting up both the client and the server in a typical Rails-style magical way, exposing to the developer just enough to get things going without having to think too much about how it’s implemented. This kind of approach is very convenient and user-friendly and is arguably one of the reasons Rails got to be such a popular tool — however it has a way of rearing its ugly little head as soon as you want to do something differently.</p><p>In our case this different way was using a bare Rails API instead of the full-stack monolith. By browsing obscure StackOverflow discussions, looking into ActionCable’s code and a lot of experimenting we have managed to make it work — and it turned out to be real simple — so we decided to share this knowledge for all future devs who might find themselves in the same predicament. Before reading on we suggest to make yourself familiar with the <a href="http://guides.rubyonrails.org/action_cable_overview.html">ActionCable’s official docs</a>.</p><p>To begin with, set up ActionCable in your Rails API app the regular way — by mounting the server to your preferred path in the routes.rb file, for example like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02a94a0b6f08ffdccaac90828af123c1/href">https://medium.com/media/02a94a0b6f08ffdccaac90828af123c1/href</a></iframe><p>This will create a new route in your app to initiate a WebSocket connection to.</p><p>The next step is authenticating your users in the ApplicationCable::Connection class. Think of it as the ActionCable’s ApplicationController — a base class that configures all the connection and authorization details, including the <em>current_user</em> helper. The preferred way to authenticate your users is by using cookies, like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4ad063a21730efc0f33475a4045e553/href">https://medium.com/media/c4ad063a21730efc0f33475a4045e553/href</a></iframe><p>However with an API app you might find yourself in a situation where no authentication cookies are available. If using a JWT (<strong>JSON Web Token</strong>) authentication you can authenticate your users by sending the current user’s token to the Connection class’ <em>connect</em> as a request parameter, decoding the token and finding the user by the identification details submitted in its payload, like this (the following example uses the <a href="https://github.com/nsarno/knock">Knock</a> gem for authentication and assumes you’re sending the user ID in the ‘sub’ section of the payload):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c3eb5e831f8acaaa8e3b72d2c34c2e2/href">https://medium.com/media/4c3eb5e831f8acaaa8e3b72d2c34c2e2/href</a></iframe><p>Now you can initiate connections to the API’s WebSockets URL. For the frontend part of your application you can use a dedicated <a href="https://www.npmjs.com/package/actioncable">actioncable npm package</a>, but you can also work with any WebSockets solution of your choosing.</p><p>Having set up the connection, we now move to Channels. Think of them as controllers — classes that accept the authenticated connection and trigger actions. They use a predefined set of callbacks that handle basic WebSockets actions like subscribing and unsubscribing, but can also utilize custom methods that you define. To start using a channel first you need to define it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7558f78168474a8be14d173b14206635/href">https://medium.com/media/7558f78168474a8be14d173b14206635/href</a></iframe><p>In the example above we have created a new class called MyChannel. It inherits from the ApplicationCable::Channel — a base class that can be used to define behaviours and methods common to all your application’s channels. The ApplicationCable::Channel and ApplicationCable::Connection are automatically created when you set up your Rails API project.</p><p>WebSockets messages sent to your API app need to have a specific structure:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/99b4ab5cc71fd7c54317c21c38417d4f/href">https://medium.com/media/99b4ab5cc71fd7c54317c21c38417d4f/href</a></iframe><p>The JSON keys available are <em>command</em>, <em>identifier</em> and <em>data</em> (the last one we’ll cover in a moment). The command key informs your connection what action you want to perform. The identifier, as the name suggests, identifies the channel class that you want to handle the specified action, but it can also identify a specific model that you want to track by passing a model_id key next to the channel identifier, like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/270fa46dfea921bdb47c387c7363b2c4/href">https://medium.com/media/270fa46dfea921bdb47c387c7363b2c4/href</a></iframe><p>The last option we’ll cover here is calling a specific method in your channel class:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/28bc4cf0f0c68a83ae00e3d5820a6625/href">https://medium.com/media/28bc4cf0f0c68a83ae00e3d5820a6625/href</a></iframe><p>In the example above we call <em>some_method</em> in MyChannel passing <em>args</em> to it. If we looked into the <em>some_method(args)</em> upon execution and printed its arguments, we’d see that what is passed to the method is a following hash:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e043bd3a05cba063039833af1b0f19b/href">https://medium.com/media/3e043bd3a05cba063039833af1b0f19b/href</a></iframe><p>Here’s an example of a method call:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c82c1e9d63868abd59dd828b75a60bd/href">https://medium.com/media/2c82c1e9d63868abd59dd828b75a60bd/href</a></iframe><p>Of course you’d probably want to pass something more than just a bare string value as an argument to the method, which brings us to the most important thing: all the values of the basic message keys (command, identifier, data) MUST be JSONized strings. ActionCable parses them by default, so the de facto structure of a subscription message needs to look as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa16170bd58471c1d791e8bdb802e2b0/href">https://medium.com/media/aa16170bd58471c1d791e8bdb802e2b0/href</a></iframe><p>The same applies to all other messages you send to your ActionCable server. The most important thing to remember here is that the above applies also to the arguments sent in the <em>data</em> key: as the ActionCable parses it using the <em>ActiveSupport::JSON.decode() </em>method, the values of the decoded JSON also need to be strings, otherwise <em>JSON::ParserError: 743: unexpected token</em> will be raised. So the actual message you send should look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5830bc9210b21db9cfafdee78d95ffd9/href">https://medium.com/media/5830bc9210b21db9cfafdee78d95ffd9/href</a></iframe><p>And that’s it — some careful JSON.parse-ing and you should get your Rails API WebSockets implementation up and running in no time.</p><p>💌 <strong>You like stories like this? Don’t miss out — </strong><a href="https://medium.com/codequest/newsletters/codequest"><strong>join our newsletter!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f087b65c860d" width="1" height="1" alt=""><hr><p><a href="https://blog.codequest.com/actioncable-in-rails-api-f087b65c860d">ActionCable in Rails API</a> was originally published in <a href="https://blog.codequest.com/">codequest</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>