Yaroslav Shmarov

Yaroslav Shmarov @superails

About: I write about different Ruby on Rails topics. Check it out!

Location:
Chernihiv, Ukraine
Joined:
Nov 4, 2017

Yaroslav Shmarov
articles - 34 total

TailwindCSS on Rails: Minimize Collapsible Sidebar

A ruby friend named Daniel emailed me a request for this feature: Here’s my solution,...

Learn More 0 2Jun 30 '24

Embedded Stripe Checkout

😖 I really dislike Stripe Elements: you have to build and style the checkout form yourself. 🤩...

Learn More 0 0Apr 30 '24

Manage active sessions in Rails 2024

Ok, so sometimes to enchance security of your application you will want to allow users to see all the...

Learn More 0 0Apr 30 '24

Turbo 8 Prefetch (InstantClick)

Inspired by instaclick.io, instaclick has been added as a default behaviour in Turbo 8. InstantClick...

Learn More 0 0Apr 30 '24

Generate PDF with Ferrum (headless Chrome API)

Thanks to URLBOX for sponsoring this blogpost! Convert URL to PNG/PDF with UrlBox screenshot API....

Learn More 0 0Apr 30 '24

Send SMS with Twilio in Rails

Over the years SMS has become a much less important way of communication , but it can still be useful...

Learn More 3 0Feb 26 '23

Live Visit Count for website or page. ActionCable, Turbo Broadcasts, Kredis

It’s amazing that now you can add advanced javascript/websockets features like “Live visitor count”...

Learn More 3 0Feb 15 '23

Omniauth without Devise

Previously I’ve covered Github omniauth with Devise, and Github omniauth with Devise without email...

Learn More 6 4Feb 7 '23

How to use the Browser Geolocation API with StimulusJS and Rails

Task: get users coordinates from browser, redirect to page with coordinates in params: To request...

Learn More 3 0Feb 5 '23

gem MapkickJS for beautiful JavaScript maps with one line of Ruby

MapkickJS is a javascript adapter to display coordinates on Mapbox maps. It requires a Mapbox API...

Learn More 4 0Feb 2 '23

gem Geocoder - calculate coordinates, distances, search nearby

Geocoder gem allows you to preform different operations with coordinates. Useful usage...

Learn More 1 0Jan 31 '23

Parse a YML/YAML file in a Ruby on Rails app

Instead of storing static data a database, you can create a structured YML or JSON file and parse it...

Learn More 1 0Jan 30 '23

How to Parse JSON with Ruby on Rails

JSON is possibly the most popular format for sharing data via API. Sometimes you just have a JSON...

Learn More 0 0Jan 29 '23

Export from database table to Excel Workbook. Level 1

Use the gem caxlsx to download and format data into XLSX. XLS - proprietary Microsoft Excel...

Learn More 3 2Aug 26 '21

Rails enums - different approaches

Enums are a Rails feature, not a Ruby feature. good - we get validations for available options, can...

Learn More 6 0Aug 9 '21

Stimulus Read More - Correct approach

I did not find an easy Stimulus solution to this, so here is mine. Works. Easy. quite Light....

Learn More 10 1Aug 3 '21

Generate PDF with gem wicked_pdf

Mission: Turn any rails view into PDF. BEFORE AFTER Video...

Learn More 11 0Jun 16 '21

TLDR - Basic search field with Ruby on Rails

MISSION: field to search for user email that contains characters....

Learn More 10 4Apr 23 '21

Install Bootstrap 5 with Ruby on Rails 6+. Replace Bootstrap 4.

console yarn add bootstrap yarn add @popperjs/core Enter fullscreen mode Exit...

Learn More 25 1Apr 2 '21

Ruby on Rails 6: Disappearing flash messages with toastr

Source library: https://github.com/CodeSeven/toastr Installation: console: yarn add...

Learn More 22 4Mar 30 '21

install gem invisible_captcha with devise

You need a captcha tool in your app. Why? For fewer bot sign-ups! You don't need Google Recaptcha...

Learn More 8 0Mar 3 '21

TLDR: counter_cache - field to count how many children a records has

conter_cache in Ruby on Rails the easy way

Learn More 4 0Feb 17 '21

TLDR: Button to update status attribute of a table

Mission: add buttons to change the status of a task HOWTO: migration - add...

Learn More 11 0Feb 15 '21

Polymorphysm 101. Part 1 of 3. Polymorphyc Comments.

My current best approach for creating polymorphic child records based on the best bits from all other...

Learn More 10 0Feb 10 '21

Ruby on Rails: Embed Youtube videos with ActionText: TLDR

Final result: app/views/youtubes/_thumbnail.html.erb <div> <%= image_tag y...

Learn More 15 1Dec 22 '20

How to copy Heroku production database into development environment?

Sometimes you want to run a copy of your production database in development. It can be really...

Learn More 9 0Dec 20 '20

How to Install FontAwesome with Yarn and Webpacker in Rails 6?

1. console: yarn add @fortawesome/fontawesome-free Enter fullscreen mode ...

Learn More 24 9Dec 10 '20

How to Embed Youtube videos with ActionText? TLDR

Final result: Here's what you need to...

Learn More 9 0Dec 9 '20

How to install Bootstrap in Rails 6 (with Yarn and Webpacker)

"Quick guide to installing Bootstrap correctly.

Learn More 15 0Dec 8 '20

Ruby on Rails 6 Credentials: Quick guide

How to use Credentials in Rails 6

Learn More 12 4Dec 7 '20