Module: Pxs::Forms::LinksHelper
- Includes:
- ActionView::Helpers::UrlHelper
- Included in:
- ModelFormBuilder, ModelsHelper
- Defined in:
- lib/pxs/forms/links_helper.rb
Instance Method Summary collapse
-
#link_button_to(text, target, options = {}) ⇒ Object
a button that makes an HTML request.
-
#turbo_link_button(text, target, options = {}) ⇒ Object
a button that triggers a turbo request.
-
#turbo_link_to(text, target, options = {}) ⇒ Object
a link that triggers a turbo request.
Instance Method Details
#link_button_to(text, target, options = {}) ⇒ Object
a button that makes an HTML request
18 19 20 |
# File 'lib/pxs/forms/links_helper.rb', line 18 def (text, target, = {}) link_to text, target, class: merge_option(:class, "button", )[:class], method: [:method] || :get, id: [:id], title: [:title], data: [:data] end |
#turbo_link_button(text, target, options = {}) ⇒ Object
a button that triggers a turbo request
12 13 14 15 |
# File 'lib/pxs/forms/links_helper.rb', line 12 def (text, target, = {}) # inject the button class to a turbo link turbo_link_to text, target, merge_option(:class, "button", ) end |
#turbo_link_to(text, target, options = {}) ⇒ Object
a link that triggers a turbo request
7 8 9 |
# File 'lib/pxs/forms/links_helper.rb', line 7 def turbo_link_to(text, target, = {}) link_to text, target, class: [:class] || nil, data: { turbo_stream: true, turbo_method: [:method] || :get, turbo_confirm: [:confirm] }.merge([:data] || {}), id: [:id], title: [:title] end |