Shrine

Shrine

  • Guides
  • Plugins
  • External
  • Discourse
  • GitHub
  • Wiki

›Storage

Introduction

  • Advantages of Shrine
  • Getting Started

Base

  • The Design of Shrine
  • Retrieving Uploads
  • Using Attacher

Storage

  • File System
  • AWS S3
  • Memory

Features

  • Direct Uploads to S3
  • Extracting Metadata
  • File Processing
  • File Validation

Extras

  • Multiple Files
  • Securing Uploads
  • Testing with Shrine

Migrating

  • Managing Derivatives
  • Migrating File Locations
  • Migrating File Storage

Extending

  • Writing a Plugin
  • Writing a Persistence Plugin
  • Writing a Storage

Upgrading

  • Upgrading to Shrine 3.x
  • Upgrading from CarrierWave
  • Upgrading from Paperclip
  • Upgrading from Refile
Edit

Memory

The Memory storage stores uploaded files in memory, which is suitable for testing.

Shrine.storages[:store] = Shrine::Storage::Memory.new

By default, each storage instance uses a new Hash object for storing files, but you can pass your own:

my_store = Hash.new
 
Shrine.storages[:store] = Shrine::Storage::Memory.new(my_store)
← AWS S3Direct Uploads to S3 →
Shrine
Docs
GuidesPluginsExternalContributing
Community
DiscourseStack Overflow
More
BlogGitHubStar
Follow @shrine_rb
Copyright © 2022 Janko Marohnić