开发者

ruby on rails: Uploading image in mysql

开发者 https://www.devze.com 2023-03-05 08:52 出处:网络
I am doing a project which allows user to upload image. Myproblem is开发者_开发知识库 how can i save the information of image in database MySQL like:

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:


There is a gem called Paperclip available. Use it.


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])
0

精彩评论

暂无评论...
验证码 换一张
取 消