nehit
nehit

Reputation: 117

ruby on rails: Uploading image in mysql

I am doing a project which allows user to upload image.
My problem is how can i save the information of image in database MySQL like:
image_path;
image_type;
image_desc:

Upvotes: 0

Views: 1528

Answers (2)

Alex Dmitriev
Alex Dmitriev

Reputation: 76

You can use the gem https://github.com/thoughtbot/paperclip. The image_desc you can to save independently.

Image.create(:image => params[:file], :image_desc => params[:desc])

Upvotes: 0

Syed Aslam
Syed Aslam

Reputation: 8807

There is a gem called Paperclip available. Use it.

Upvotes: 1

Related Questions