Class: TestsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb

Instance Method Summary collapse

Instance Method Details

#frame_contentObject



16
17
18
19
20
21
22
# File 'lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb', line 16

def frame_content
  # Render turbo frame content
  render turbo_stream: turbo_stream.replace(
                         request.headers['Turbo-Frame'] || 'lazy-content',
                         partial: 'tests/frame_content'
  )
end

#stimulusObject



4
5
6
# File 'lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb', line 4

def stimulus
  # Test halaman untuk Stimulus
end

#turbo_driveObject



8
9
10
# File 'lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb', line 8

def turbo_drive
  @timestamp = Time.current
end

#turbo_frameObject



12
13
14
# File 'lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb', line 12

def turbo_frame
  # Test halaman untuk Turbo Frames
end

#update_contentObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb', line 24

def update_content
  @timestamp = Time.current

  respond_to do |format|
    format.turbo_stream do
      render turbo_stream: [
        turbo_stream.update('dynamic-content', partial: 'tests/updated_content'),
        turbo_stream.append('log', partial: 'tests/log_entry', locals: { timestamp: @timestamp })
      ]
    end
  end
end