With the help of the paperclip-dropbox heme, pictures are stored on the dropbox, the pictures are successfully loaded, but not the pictures themselves are displayed while viewing, but their name.
Here is my model:
class User < ApplicationRecord validates :name, presence: true has_attached_file :avatar, :storage => :dropbox, :dropbox_credentials => Rails.root.join("config/dropbox.yml"), :dropbox_visibility => 'public', # :dropbox_options => {...}, styles: { medium: "400x400>", thumb: "100x100>" }, default_url: "event.jpg" validates_attachment_content_type :avatar, content_type: /\Aimage\/.*\z/ end ... controller:
def index @users = User.all end def new @user = User.new end def create @user = User.new(user_params) if @user.save render 'create' else render 'new' end end private def user_params params.require(:user).permit(:name, :avatar) end ... and the view, the list of users with avatars is passed by the partial. The view itself:
New user:<br/> <%= link_to 'new user', new_user_path %> <hr/> <%= render partial: 'users/user', collection: @users %><br/> ... and the partial:
<%= link_to user.name, user_path(user) %> <% if user.avatar != nil %> <%= image_tag user.avatar.url %> <% end %> According to the documentation, the helper <% = image_tag user.avatar.url%> should display a picture, but actually displays the file name. When viewing the page as html shows that it can not download the file. If you work with the paperclip gem in the file storage mode on the disk and not in the cloud, then everything works.
What am I doing wrong, tell me!