开发者

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:


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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜