julianrubisch

Joined

3,370 Experience
33 Lessons Completed
0 Questions Solved

Activity

Posted in How to Test Gem Dependencies with Appraisal Discussion

Silly me... added it to my Appraisals file:

appraise "rails-6-0" do
gem "rails", "~> 6.0"
gem "sqlite3", "~> 1.4"
end

appraise "rails-5-2" do
gem "rails", "~> 5.2"
gem "sqlite3", "~> 1.3", "< 1.4"
end

Posted in How to Test Gem Dependencies with Appraisal Discussion

Thanks Chris, I actually can use this for making futurism future-proof 😅

The only thing I see is (and I'm using the exact same setup you do in that video), that appraisal fails to correctly load the sqlite3 gem, because apparently ActiveRecord 5.2 and 6.0 have different dependencies:

https://github.com/rails/rails/blob/v5.2.2/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L12

Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.2. Make sure all dependencies are added to Gemfile. (Gem::LoadError)

Have you seen this and/or have any idea how to fix it?

Posted in Render before action completes

Futurism relies on CableReady which will just swap out any placeholders once the contents are ready. It expects them to be wrapped in partials though

Posted in Render before action completes

Let me know if I can help!

Thanks @excid3, very neat :-) One comment though, as capturing scroll events like this is usually quite CPU-intensive, wouldn't it be better to use an IntersectionObserver? (https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver)

also see: https://m.signalvnoise.com/how-to-back-to-top-button-without-scroll-events/

Posted in Stimulus JS Twitter UI: Part 1 Discussion

Hi Chris,

great video!

One thing I like to do these days is, instead of responding with a create.js.erb, catch the ajax:success event in the stimulus controller (possibly even by attaching it to document: https://stimulusjs.org/reference/actions#global-events).

You don't get inline rendering of your Rails ivar this way, but you stay in the context of your controller and don't have to use that kind of "hacky" way of updating the form/character count, since you have access to this.element and your targets...

I built that w/ActionCable just last week. Should I write up a blog post?

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.