Grant Leslie
Grant Leslie

Reputation: 51

How to upload and save an image to /assets/images in Rails

Total noob question here, but how would I make a simple upload portal that allows me to upload an image to the /assets/images folder? It doesn't need to be saved to an object at all. I just need to upload an image.

I have active admin, if that is of any assistance.

Thanks so much!

Upvotes: 1

Views: 5612

Answers (4)

Piers C
Piers C

Reputation: 2978

If you are using ActiveAdmin visit the wiki page for links to various tutorials and how-tos, including this one for PaperClip

Upvotes: 0

Pablo E. Lujambio
Pablo E. Lujambio

Reputation: 177

The assets/images folder in rails is intended for assets that your project uses, such as the company/site/project logo, icons, favicons, etcetera. It isn't meant to be a folder for uploading user nor admin generated assets.

If it is an image that needs to be user administered, then you should use a server for that such as Amazon S3.

Here is a nice Heroku tutorial on that

Upvotes: 0

Ajay sharma
Ajay sharma

Reputation: 41

Rails provide many gems for uploading like :

Paperclip: https://github.com/thoughtbot/paperclip

CarrierWave : https://github.com/carrierwaveuploader/carrierwave


Upvotes: 0

Trenton Tyler
Trenton Tyler

Reputation: 1712

So as not to further increase the size of the project folder I recommend storing images in a database.

This gem will help you achieve image uploads - https://github.com/thoughtbot/paperclip

Upvotes: 2

Related Questions