baoagency / polaris_view_components

ViewComponents for Polaris Design System
https://polarisviewcomponents.org
MIT License
388 stars 55 forks source link

Support `button_to` on navigation item #427

Closed remy727 closed 4 months ago

remy727 commented 4 months ago

WHY are these changes introduced?

Resolves #423

WHAT is this pull request doing?

Support button_to on navigation item

Usage

<%= polaris_navigation do |navigation| %>
  <% navigation.with_section do |section| %>
    <% section.with_item(
      url: destroy_user_session_path,
      label: "Logout",
      icon: "ExitIcon",
      action_type: :button,
      link_arguments: {
        method: :delete,
        data: {
          turbo: false
        }
      }
    ) %>
  <% end %>
<% end %>
kirillplatonov commented 4 months ago

Awesome! Thanks for contribution 👍