Class: TestsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- TestsController
- Defined in:
- lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb
Instance Method Summary collapse
- #frame_content ⇒ Object
- #stimulus ⇒ Object
- #turbo_drive ⇒ Object
- #turbo_frame ⇒ Object
- #update_content ⇒ Object
Instance Method Details
#frame_content ⇒ Object
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 |
#stimulus ⇒ Object
4 5 6 |
# File 'lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb', line 4 def stimulus # Test halaman untuk Stimulus end |
#turbo_drive ⇒ Object
8 9 10 |
# File 'lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb', line 8 def turbo_drive @timestamp = Time.current end |
#turbo_frame ⇒ Object
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_content ⇒ Object
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 |