0.0.7 • Published 4 years ago

@mainkatz/image-input v0.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Image Input

A Rails helper for a simple, clean image input for use with Active Storage.

Example usage:

class User < ApplicationRecord
  has_one_attached :profile_picture
end
<%= form_with(model: User.new) do |form| %>
  <%= image_input form, :profile_picture %>
<% end %>

NOTE: The styles of this project are constructed using Tailwind CSS.

Installation

Add to your Gemfile:

gem 'image_input'
bundle install
yarn add @mainkatz/image-input

Register Stimulus controller. By default in Rails, this is in controllers/index.js.

import ImageInputController from '@mainkatz/dropzone-input';

application.register('image-input', ImageInputController);

Development

To develop this locally you can update your Gemfile:

gem 'image_input', path: 'PATH_TO_PROJECT'

In this project run:

yarn link

In your app project run:

yarn link @mainkatz/image-input

To auto-recompile this project, run:

yarn run dev
0.0.7

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago