phq

Joined

670 Experience
6 Lessons Completed
0 Questions Solved

Activity

Posted in User Avatars with ActiveStorage Discussion

Yes, I resolved it. When I trial this, I used Rails 7 alpha2. I need to

  • Install some libvips & make config for it to work --> I think we don't need this if you use Rails 7.0. Because I hear that lipvips are used by default in this latest Rails release
    Gemfile
    gem 'image_processing', '~> 1.2'
    development.rb
    # config :vips lib for image processing
    config.active_storage.variant_processor = :vips

  • Remove gravatar_image_tag from Gemfile and use this helper
    def display_avatar_url(size: :middle)
    height = AVATAR_SIZE[size] || size
    if avatar.attached?
    avatar.variant(resize_to_fill: [height, nil])
    else
    "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(name)}?d=identicon&s=#{height}"
    end
    end

Posted in User Avatars with ActiveStorage Discussion

I got a problem with line
<%= image_tag gravatar_image_url(current_user.email, size: 100), height: 100, width: 100, class: "rounded-circle" %>

Error message:
Showing app/views/devise/registrations/edit.html.erb where line #17 raised:
undefined method `escape' for URI:Module

With Ruby3.0, URI.escape was removed
https://github.com/ruby/uri/issues/14#issuecomment-751501927

Posted in How to setup Deno with Neovim's COC

Hi,

I am using Neovim, COC with LSP. I installed Deno for Javascript. It is
Plug 'williamboman/nvim-lsp-installer'
Plug 'prabirshrestha/vim-lsp'
Plug 'neovim/nvim-lspconfig'
Plug 'glepnir/lspsaga.nvim'

The plugins work great, it is fast and helpful. However, I always get the error at "import" statement
Relative import path "@hotwired/stimulus" not prefixed with / or ./ or ../ from

This error happens with this import statement
import { Controller } from '@hotwired/stimulus'

This is very common import statement that I think it was generated by default when creating a stimulus controller.
I am not sure what is wrong and how to avoid it. Maybe, I need to add some config for Deno. But I am not so familiar with this tool.

Could you please let me know how to avoid this issue ?

Thanks,