Class: TurboScroll::More
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- TurboScroll::More
- Includes:
- Turbo::FramesHelper
- Defined in:
- lib/turbo-scroll/more.rb
Instance Attribute Summary collapse
-
#loader_dom_id ⇒ Object
readonly
Returns the value of attribute loader_dom_id.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
-
#initialize(page:, loader_dom_id: :turbo_loader) ⇒ More
constructor
A new instance of More.
- #next_page_path ⇒ Object
- #next_page_stream_path ⇒ Object
- #query_params ⇒ Object
- #render? ⇒ Boolean
Constructor Details
#initialize(page:, loader_dom_id: :turbo_loader) ⇒ More
Returns a new instance of More.
10 11 12 13 |
# File 'lib/turbo-scroll/more.rb', line 10 def initialize(page:, loader_dom_id: :turbo_loader) @page = page @loader_dom_id = loader_dom_id end |
Instance Attribute Details
#loader_dom_id ⇒ Object (readonly)
Returns the value of attribute loader_dom_id.
8 9 10 |
# File 'lib/turbo-scroll/more.rb', line 8 def loader_dom_id @loader_dom_id end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
8 9 10 |
# File 'lib/turbo-scroll/more.rb', line 8 def page @page end |
Instance Method Details
#next_page_path ⇒ Object
20 21 22 |
# File 'lib/turbo-scroll/more.rb', line 20 def next_page_path url_for(page: page, **query_params) end |
#next_page_stream_path ⇒ Object
24 25 26 |
# File 'lib/turbo-scroll/more.rb', line 24 def next_page_stream_path url_for(format: :turbo_stream, page: page, **query_params) end |
#query_params ⇒ Object
15 16 17 18 |
# File 'lib/turbo-scroll/more.rb', line 15 def query_params @query_params ||= request.query_parameters.except(:page, :raw, :format) end |
#render? ⇒ Boolean
28 29 30 |
# File 'lib/turbo-scroll/more.rb', line 28 def render? page end |