David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
Ruby Rogues Panelist
David Kimura PRO said over 3 years ago on StimulusJS, Active Storage and DropzoneJS :
  By chance, are you overriding ActiveStorage::DirectUploadsController#create? I've pulled your view code and stimulus controller code into the project, updated to Rails 6.1.3.1, updated yarn packages (active storage, ujs and dropzone). It still works locally.

David Kimura PRO said over 3 years ago on StimulusJS, Active Storage and DropzoneJS :
  Personally, I'm not a fan of Less/HAML, but one thing that you could try doing is to inspect the rendered HTML from both scenarios to see if there is any difference. There could be one little change that is causing the whole smash to do something strange.

David Kimura PRO said over 3 years ago on Gem in a Box :
  It's just a preference when creating an array or hash. In this particular case there wouldn't be any benefit over
array = []
array << { username: 'username', password: 'password' }

However, in many other situations doing a [].tap or {}.tap is pretty handy in conditionally adding items. For example,

User.new(user_params)

def user_params
  allowed_params = [].tap do |array|
    array << :first_name
    array << :last_name
    array << :admin if current_user.admin?
  end
  params.require(:user).permit(allowed_params)
end



David Kimura PRO said over 3 years ago on Creating and Reading QR Codes :
  Look at your browser's console to see if there are any errors

David Kimura PRO said over 3 years ago on Hotwire & ViewComponents :
I think that would be a worthy episode :)