Sha256: 59bc792c5aad4e9c395b04e49c411e821cb36ac085dcef7fc4dbf8c965c3c413

Contents?: true

Size: 1.8 KB

Versions: 9

Compression:

Stored size: 1.8 KB

Contents

# frozen_string_literal: true

class <%= class_name %>Reflex < ApplicationReflex
  # Add Reflex methods in this file.
  #
  # All Reflex instances include CableReady::Broadcaster and expose the following properties:
  #
  #   - connection  - the ActionCable connection
  #   - channel     - the ActionCable channel
  #   - request     - an ActionDispatch::Request proxy for the socket connection
  #   - session     - the ActionDispatch::Session store for the current visitor
  #   - flash       - the ActionDispatch::Flash::FlashHash for the current request
  #   - url         - the URL of the page that triggered the reflex
  #   - params      - parameters from the element's closest form (if any)
  #   - element     - a Hash like object that represents the HTML element that triggered the reflex
  #     - signed    - use a signed Global ID to map dataset attribute to a model eg. element.signed[:foo]
  #     - unsigned  - use an unsigned Global ID to map dataset attribute to a model  eg. element.unsigned[:foo]
  #   - cable_ready - a special cable_ready that can broadcast to the current visitor (no brackets needed)
  #   - reflex_id   - a UUIDv4 that uniquely identies each Reflex
  #   - tab_id      - a UUIDv4 that uniquely identifies the browser tab
  #
  # Example:
  #
  #   before_reflex do
  #     # throw :abort # this will prevent the Reflex from continuing
  #     # learn more about callbacks at https://docs.stimulusreflex.com/rtfm/lifecycle
  #   end
  #
  #   def example(argument=true)
  #     # Your logic here...
  #     # Any declared instance variables will be made available to the Rails controller and view.
  #   end
  #
  # Learn more at: https://docs.stimulusreflex.com/rtfm/reflex-classes

<% actions.each do |action| -%>
  def <%= action %>
  end
<%= "\n" unless action == actions.last -%>
<% end -%>
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
stimulus_reflex-3.5.0.pre8 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre7 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre6 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre5 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre4 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre3 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre2 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre1 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt
stimulus_reflex-3.5.0.pre0 lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt