Organize your CSS in the Tailwind style with @layer directive
Tailwind provides `@layer` directive to help you better organize your CSS. This post is a detailed breakdown of the directive with examples.
- Date
Tailwind provides `@layer` directive to help you better organize your CSS. This post is a detailed breakdown of the directive with examples.
A guide on installing PrismJS with babel-plugin-prismjs, using APIs for various scenes, and extra notes and caveats.
When passing an `ActiveRecord::Relation` to a `where` clause, Rails converts it to a subquery.
`ActiveStorage::Blob` records with invalid value (`text/html`) was the culprit.
Active Storage default variant processor changed to :vips since Rails 7. Learn how to install the required libvips on Heroku.
See what's the default order Rails scaffold generates. A Rubocop Cop is also on the way.
A brief introduction to ViewComponent: the API, folder structure, values and concerns.
It can be useful to define an inline disposable class in the spec so you can test a module/concern or a middleware cleanly and separately.
My pre-defined criteria and research notes led me to Anne Pro 2.
Don't use Ruby 2.7 specific RUBYOPT environment variable when you also run other rubies that are < 2.7
These 2 commands help you find out where things get slow.
Notes of upgrading my free tier Heroku Postgres database from 9.6 to 12.2.
Learn how Transient Attributes works and how to simplify the setup of associated records with it.
All in the title 😎 with a Rails CSRF gotcha
Separation of positional and keyword argument: What you need to know and how to fix (or suppress).
I had the opportunity to upgrade 3 Rails apps. Here are some notes from that experience.
Increase your sender reputation and email deliverability.
A quick workaround to make it behave as expected.
Upgrade Heroku apps to heroku-18 Stack via command line.
TL;DR - Include the CSRF token in the headers to avoid the InvalidAuthenticityToken exception.
I attended SmashingConf Toronto last week. It was such a lovely event.
The good and caveats when using ActiveStorage after upgrading to Rails 6
chromedriver-helper is out of support as of 2019-03-31. Webdrivers is recommended as the replacement. It's also included in the Rails 6 Gemfile. Time for the switch! ️ Install Webdrivers gem bundle install and it's (almost) done! There is no...
Stimulus supports multiple actions on a single element. For example, you can have a link like this: When the link is clicked, it'll go through session_controller.js first to check whether the user is logged in, and if so, continue to comment_co...
Whenever you find a design, a layout, an animation, a typography, a scenario that wow (or urgh) you, take a screenshot and write down just one sentence why you feel that way. Verbalize the intangible feeling, put them into plain words no matter ho...
Chrome 73 comes with the support of Mac Dark Mode - if you've set your Mac OS run on the dark mode, Chrome will get that automatically. That also means you can't turn it off, not from Chrome's setting page. Here is the magic script to revert that...
In my previous post, I covered how to use bootstrap.native so you can drop the jQuery dependency right now. In this post, I'm gonna share how to use Toast component with bootstrap.native. Toast UI This popular UI component was added in Bootst...
Bootstrap 5 will remove jQuery as a dependency. That's good news ! But if you want to drop the dependency right now, you can accomplish it with bootstrap.native. bootstrap.native is a third-party plugin that perfectly mimics Bootstrap with vanil...
TL;DR Be sure to include the CSRF token into the headers, otherwise, you'll run into InvalidAuthenticityToken exception. In old-fashioned Rails apps, CSRF token is handled by rails-ujs transparently so there is no extra work for you. However,...
Another month goes by. After reached the peak of my nerd life at Blizzcon 2018 and completed one of my bucket list, there are a lot of things to be reflected upon. But first thing first, I'm gonna share some of the updates from Bloggie . Title C...
We can already write JavaScript in ES6 syntax with Webpacker. But if you're in the transition phase to migrate an old Rails app from Sprockets (Asset Pipeline) to Webpacker, you might still want to keep your Coffeescript files in use. The default...
Hi, this is kinopyo from the Bloggie team . Today I want to reboot our monthly product update series and show you what happened for the last month. Normally this kind of reports would showcase the product behavior changes that bring value to the ...
Parity is a set of shell commands from thoughtbot that help you easily manage Heroku staging and production apps, such as deployment, syn...
Suppose you send a Pull Request to fix a bug or implement a feature that is raised as an "issue" on Github. It would be tedious to rememb...
I have a feature spec to test the Javascript behavior of the blur event, sadly Capybara's native DSL doesn't seem to support it yet. After quick research, I found two options. Simulate tab away from the element Click the page body My Pick Both ...
After switching from Sprockets to Webpacker, I also dropped the gem Turbolinks from my Gemfile and integrated it with Webpacker. That had been running well until redirect_to stopped working. To be more accurate: It appeared redirect_to won't up...
Rails.application.config_for is a convenient method to load custom yaml file from config/ folder for your current environment - development, test, and production. Getting Started For example, you have a payment config file like this: Rails.a...
I was trying to add a Slack webhook to the Rails app, when I ran bin/rails credentials:edit I got the error ActiveSupport::MessageEncryptor::InvalidMessage. Why that happened? It turned out it was because I lost the key 😅 (config/master.key) . T...
Assume you have a markdown contents saved in a partial _about.md and you want to render it in your view. Custom Template Handler First, you would need to register the type/extension of .md and map it into a customized handler - let's call i...
It's a common practice to return the user to the previous page or a specific page after he/she successfully logged in. If you're using OmniAuth, it's already well supported in the gem! The is request.env['omniauth.origin']. Scenario: return to ...
Get you started with Active Storage. Understand its data model, common usages, how to write the test, and possible gotchas.