Search
Get Started
Join Bloggie
A modest blog platform crafted for developers
Continue with Twitter
Continue with Github
By creating an account I accept Bloggie's
Terms of Service
and
Privacy Policy
.
Featured
ViewComponent: My attempt to answer what value it brings
A brief introduction to ViewComponent: the API, folder structure, values and concerns.
kinopyo
Dec 17, 2020
Latest
Install latest libvips for image_processing on Heroku
Active Storage default variant processor changed to :vips since Rails 7. Learn how to install the required libvips on Heroku.
kinopyo
Feb 14, 2022
Rails controller actions ordering convention
See what's the default order Rails scaffold generates. A Rubocop Cop is also on the way.
kinopyo
Jan 28, 2022
RSpec define inline class to test modules
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.
kinopyo
Dec 14, 2020
The Practical Usage of factory_bot Transient Attributes
Learn how Transient Attributes works and how to simplify the setup of associated records with it.
kinopyo
Mar 29, 2020
A few notes on upgrading to Rails 6
I had the opportunity to upgrade 3 Rails apps. Here are some notes from that experience.
kinopyo
Oct 20, 2019
Prevent Turbolinks from reloading the page when clicking anchor links
A quick workaround to make it behave as expected.
kinopyo
Oct 1, 2019
Sending non-GET requests with Fetch JavaScript API in Rails
TL;DR - Include the CSRF token in the headers to avoid the InvalidAuthenticityToken exception.
kinopyo
Aug 18, 2019
Upgrade Guide: ActiveStorage in Rails 6 and ImageProcessing
The good and caveats when using ActiveStorage after upgrading to Rails 6
kinopyo
May 26, 2019
Migrate from chromedriver-helper to Webdrivers
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...
kinopyo
May 17, 2019
Stimulus: Stop event chain in the middle of multiple actions
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...
kinopyo
Apr 17, 2019
bootstrap.native: How to Use Toast Component
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...
kinopyo
Mar 13, 2019
bootstrap.native - Bootstrap without jQuery
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...
kinopyo
Feb 22, 2019
Sending POST Requests With window.fetch In Rails
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,...
kinopyo
Jan 7, 2019
Rails: Enable Coffeescript with Webpacker
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...
kinopyo
Oct 24, 2018
Capybara: Trigger Blur Event
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 ...
kinopyo
Aug 16, 2018
You Might Still Need the Turbolinks Rails Gem Even with Webpacker
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...
kinopyo
Aug 9, 2018
Rails: The Convenient Way to Load Custom Configuration Yaml File
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...
kinopyo
Aug 2, 2018
Error during rails credentials:edit "ActiveSupport::MessageEncryptor::InvalidMessage"
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...
kinopyo
Jul 23, 2018
Rails: Render Markdown Views and Partials
Assume you have a markdown contents saved in a partial _about.md and you want to render it in your view. Custom Template Handler F...
kinopyo
Jul 10, 2018
Return to the previous or a specific page after login with OmniAuth
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 ...
kinopyo
Apr 9, 2018
7 Practical Tips for ActiveStorage on Rails 5.2
Get you started with Active Storage. Understand its data model, common usages, how to write the test, and possible gotchas.
kinopyo
Apr 4, 2018
name
Rails
Categories
Rails
JavaScript
Android
Ruby
PHP
Design
Web Dev
All posts