Module: ActiveStorage::AsyncVariants
- Defined in:
- lib/active_storage/async_variants/ui.rb,
lib/active_storage/async_variants/helper.rb,
lib/active_storage/async_variants/ui/version.rb,
lib/active_storage/async_variants/asset_tag_helper_extension.rb,
app/controllers/active_storage/async_variants/states_controller.rb
Defined Under Namespace
Modules: AssetTagHelperExtension, Helper, UI Classes: StatesController, UIEngine
Constant Summary collapse
- PASS_THROUGH_HTML_OPTIONS =
HTML attributes round-tripped through the state-endpoint URL so the eventual processed-state render can apply them to the inner <img>/<video>.
%i[alt width height controls autoplay preload].freeze
- Assets =
IsolateAssets.register(namespace: self, engine: UIEngine, route_name: :async_variant_asset)
Class Method Summary collapse
- .retry_visible?(view) ⇒ Boolean
-
.retry_visible_if(&block) ⇒ Object
Gates the failed-state retry affordance; the block runs in the view context.
Class Method Details
.retry_visible?(view) ⇒ Boolean
29 30 31 32 33 |
# File 'lib/active_storage/async_variants/ui.rb', line 29 def self.retry_visible?(view) !!view.instance_exec(&retry_visible_proc) rescue StandardError false end |
.retry_visible_if(&block) ⇒ Object
Gates the failed-state retry affordance; the block runs in the view context.
25 26 27 |
# File 'lib/active_storage/async_variants/ui.rb', line 25 def self.retry_visible_if(&block) self.retry_visible_proc = block end |