I create a post and inside the post I want to use pictures. I use Paperclip to upload images.
There is a form new.haml
.container %header %h1 Новая статья = simple_form_for @post do |f| %h5 Тема = f.input :theme, label: false %h5 Аннотация = f.input :annotate, label: false %h5 Основная картинка = f.file_field :main_image %h5 Текст статьи = f.input :text, label: false %h5 Изображения .illustrations = f.simple_fields_for :illustrations do |ill| .entry = ill.file_field :image %button.btn.btn-add{:type => "button", :id => "add_image"} 'Добавить еще картинку' = f.submit 'Создать' From it I can add a lot of pictures to the post.
The question is: how to register a link to a picture in the text of the post. To markdown dismantled it.
PS I saw an article on this topic, but they refer to id pictures in the table, but I don’t have one yet. How to be I do not know.
Thanks in advance.