Add TurboPower Rails gem for nice helpers

The helpers are more convenient but also allow us to add options like
smooth scrolling. I thought that looked nicer and is less confusing.

Please note that the `scroll_into_view` helper uses the `targets`
attribute instead of `target`. That attribute needs CSS selectors with a
leading `#` for ids.
This commit is contained in:
Maikel Linke
2024-08-15 16:50:27 +10:00
parent d354317c73
commit 61f2954973
3 changed files with 5 additions and 1 deletions

View File

@@ -104,6 +104,7 @@ gem 'sidekiq-scheduler'
gem "cable_ready"
gem "stimulus_reflex"
gem "turbo_power"
gem "turbo-rails"
gem 'combine_pdf'

View File

@@ -785,6 +785,8 @@ GEM
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
turbo_power (0.6.2)
turbo-rails (>= 1.3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
@@ -973,6 +975,7 @@ DEPENDENCIES
stripe
timecop
turbo-rails
turbo_power
valid_email2
validates_lengths_from_database
vcr

View File

@@ -2,4 +2,4 @@
= button t(:go), "report__submit-btn", "submit", disabled: true
= turbo_stream.update "report-table" do
= render "admin/reports/loading"
= turbo_stream.action(:scroll_into_view, "report-table")
= turbo_stream.scroll_into_view("#report-table", behavior: "smooth")