I have a site where the user can add an avatar to himself through Gravatar. But, unfortunately, the form does not work for me ... I get an error like:
TypeError in Devise::Registrations#edit Showing /home/artem/projects/blog/app/views/devise/registrations/edit.html.erb where line #13 raised:
no implicit conversion of Enumerator into String
Application Trace | Framework Trace | Full Trace app/views/devise/registrations/edit.html.erb:13 app/views/devise/registrations/edit.html.erb:5
My form looks something like this:
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<div class="form-group mt-4">
<div class="row">
<div class="col-sm-4">
<% if resource.avatar.attached? %>
<%= image_tag resource.avatar.variant(resize: "100x100!"),
class: "rounded-circle" %>
<% else %>
<%= image_tag gravatar_image_url(current_user.email.gsub(size: 100)),
height: 100,
width: 100,
class: "rounded-circle" %>
<% end %>
</div>
<div class="col-sm-5">
<%= f.file_field :avatar %>
</div>
</div>
</div>
...
<% end %>
Account system made by Devise.
Nothing is written about this, therefore, I don’t even know what I can try to solve the problem.
Fifth line: <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
13: <%= image_tag gravatar_image_url(current_user.email.gsub(size: 100)),