Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add method and params to link_to method in the profile menu #1780

Merged
merged 3 commits into from
Jun 7, 2023

Conversation

adrianthedev
Copy link
Collaborator

@adrianthedev adrianthedev commented Jun 7, 2023

Description

Adds the ability to add method and params to the link_to helper in profile menu items.

Fixes #1666

Docs: https://docs.avohq.io/2.0/menu-editor.html

Avo.configure do |config|
  config.profile_menu = -> do
    link_to "Sign out", path: main_app.destroy_user_session_path, icon: "user-circle", method: :post, params: {hehe: :hoho}
  end
end

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@codeclimate
Copy link

codeclimate bot commented Jun 7, 2023

Code Climate has analyzed commit 5e0568e and detected 0 issues on this pull request.

View more on Code Climate.

@useattractor
Copy link

useattractor bot commented Jun 7, 2023

feature: add method and params to link_to method in the profile menu 🔗

Stats

Language Score Trend
Ruby 8.66 (from 8.66) 📉 -0.01
JavaScript 28.35 (from 28.35) 📉 0.0

Trends

Most Improved Largest Declines
Ruby No decreases for Ruby detected lib/avo/menu/link.rb and app/components/avo/profile_item_component.rb
JavaScript No decreases for JavaScript detected No increases for JavaScript detected

To-Dos

New to Refactor Refactored
Ruby No new To-Dos for Ruby detected No completed To-Dos for Ruby detected
JavaScript No new To-Dos for JavaScript detected No completed To-Dos for JavaScript detected

@adrianthedev adrianthedev merged commit 8f067f7 into main Jun 7, 2023
14 checks passed
@adrianthedev adrianthedev deleted the feature/add-method-to-profile-menu-link-to branch June 7, 2023 10:23
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There currently isn't a way to sign out using rodauth
1 participant