Rails on the rails!

christopher diercksen
2 min readJun 6, 2021

This past week I was able to complete my Rails project for Flatiron School, and it’s come with a lot of personal lessons. The greatest of which, is how isolation from my peers is a death trap for my productivity and ability to learn. My time learning the ins and outs of software engineering at Flatiron during a global pandemic has been one of the most challenging periods of my life, as it has revealed in stark detail a great many weaknesses of mine. If these past few weeks are to be the low-point in my learn-to-code journey then I shall be grateful.

But the flip-side to learning one’s weaknesses is it also reveals one’s strengths. Though I may be isolated now, coding itself is often very collaborative, and in that scenario I am able to learn and contribute on a much greater scale I thought possible. I am, at my core, a helper.

So it is fitting then, to segue into my favorite bit of rails code: the helper method.

While they are technically modules, helpers in rails are more practically used to follow repeatable logic most commonly applied in your views. this cleans up your code by handling repeated complex tasks elsewhere which helps keep the code DRY, and therefor easier to read/test.

Say for example you wanted your view to format nine numbers to look like a phone number:

number_to_phone(5555555555) # => 555-555-5555

Rails provides the above helper_method that can be used on any view page in place of the logic that would otherwise bog down your code.

--

--

christopher diercksen
0 Followers

Theater Director, Dramaturg, Producer, Improvisor, Artistic Director, Office Manager, Software Engineering Student. (He/They)