The project is in a healthy, maintained state
Comprehensive Rails integration for ImageKit.io with view helpers (ik_image_tag, ik_video_tag) and Active Storage service adapter. Provides easy image optimization, transformation, and responsive image support.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 3.6
~> 3.0
~> 1.21
~> 1.8
~> 0.9

Runtime

>= 6.0
 Project Readme

ImageKit Rails

Rails view helpers and Active Storage integration for ImageKit.io.

Gem Version License

Overview

The ImageKit Rails gem provides seamless integration with Ruby on Rails applications, including:

  • View helpers (ik_image_tag and ik_video_tag) with transformation support
  • Active Storage service for storing files in ImageKit
  • Automatic responsive images with srcset generation
  • Image and video transformations (resize, crop, effects, overlays)
  • Signed URLs for secure delivery

Installation

Add to your Gemfile:

gem 'imagekitio-rails'

Run:

bundle install

This will automatically install the required imagekitio core SDK (version 4.x) as a dependency.

Quick Start

Create config/initializers/imagekit.rb:

Imagekit::Rails.configure do |config|
  config.url_endpoint = ENV['IMAGEKIT_URL_ENDPOINT']
  config.public_key = ENV['IMAGEKIT_PUBLIC_KEY']
  config.private_key = ENV['IMAGEKIT_PRIVATE_KEY']
end

Get your credentials from ImageKit Dashboard → API Keys.

Basic Usage

<!-- Display an image with transformations -->
<%= ik_image_tag("/photo.jpg", transformation: [{ width: 400, height: 300 }], alt: "My Photo") %>

<!-- Display a video -->
<%= ik_video_tag("/video.mp4", controls: true) %>

<!-- Active Storage attachment with transformations -->
<%= ik_image_tag(@user.avatar, transformation: [{ width: 200, height: 200 }]) %>

Documentation

Support

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/imagekit-developer/imagekit-rails.

License

Apache License 2.0. See LICENSE for details.