Rails with Webpacker, a full setup
Create a new Rails application without Webpacker Minimal application $> rails new myapp --minimal $> cd myapp The minimal flag means “please install a default Rails app with the fewest po...
Create a new Rails application without Webpacker Minimal application $> rails new myapp --minimal $> cd myapp The minimal flag means “please install a default Rails app with the fewest po...
Hot reloading just works™ Hot reloading means “auto-refreshing the browser when the developer modifies a file”. It’s 2021, now all web frameworks (at least in the JavaScript space) have hot-reloa...
0. Setup If you want a setup from scratch, see this article. 1. Download the source file Go to the “download” section of Bootstrap, the URL should look like https://getbootstrap.com/docs/5.0/gett...
So how do you switch to case/when ? Case statements in Ruby are very powerful. To quote the popular ProgrammingRuby book, “The Ruby case expression is a powerful beast: a multiway if on steroids....
How to declare a private method class Wolf def scare "scaring..." end private def sleep "sleeping.." end def eat "eating.." end end All methods above the key...
Is it related to Rails anyway ? Tailwind and Bootstrap are both CSS frameworks, so one could argue that they have nothing to do with Rails itself. Which is true. But both try to “get things done” ...
0. Prerequisite You will need both Rails and Bootstrap for this tutorial. I already wrote a tutorial about this, so just follow the steps, or checkout the corresponding GitHub repository in order ...
0. The ancient times : before Sprockets I wasn’t in the Ruby-on-Rails industry at that time, so I asked other people what was there. Surprisingly, the answer is : nothing. You just had to copy/pas...
“if” alone may not be enough if false or if nil won’t execute the corresponding condition, because false and nil are considered as falsy values. In other words, if you cast nil or false as a bool...
Ruby is not complicated Ruby has both OOP and functional abilities. The only "tricky" part are blocks (see below). My advice here is to buy a book, or buy a course. The one of Nicole and Mike is e...