How to add an image field to a Rails application?

I am creating a rails application that has a field for loading an image. I do not know how to handle images in Rails. (The uploaded image will also require some processing.) Can someone tell me how I can do this?

thank.

+3
source share
4 answers

I would suggest using paperclip.

This can help. And this .

+8
source

rails ? , , , .

, , , , src; rails, , , - , :

<%= link_to "<span>fig." + (order+1).to_s + "</span>" + image_tag(url_for(:controller => 'upload', :action => 'picture', :id => picture.id), :class => 'list-image'), {:controller => 'upload', :action => 'show', :id => picture.id}, :class=>'head-image' %>

pictures.each, 'upload' , ( ). , ( css, ), ( AJAX /, ).

, , , RoR.

: Ach, . , , . ; Attachment_fu . ( / , .)

+1

RMagick gem . , / . . .

+1

PaperclipPolymorph, Paperclip, , .

0

Source: https://habr.com/ru/post/1749424/


All Articles