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

Devise sign-out link broken by default. Rails-turbo or rails/ujs required. #484

Open
eoinkelly opened this issue Sep 3, 2023 · 3 comments · Fixed by #497
Open

Devise sign-out link broken by default. Rails-turbo or rails/ujs required. #484

eoinkelly opened this issue Sep 3, 2023 · 3 comments · Fixed by #497
Labels
ready for dev ruby Pull requests that update Ruby code

Comments

@eoinkelly
Copy link
Contributor

Symptoms

Currently the apps we generate have neither rails-ujs nor rails-turbo installed. This means that the Devise sign out link will not work:

<a rel="nofollow" data-method="delete" href="/users/sign_out">Sign out</a>

Why is this happening?

Rails 7 does not automatically import any JS for us.

Our options

Option 1: enable @rails/ujs

  1. yarn install @rails/ujs
  2. add the following to our packs/application.js
    import Rails from '@rails/ujs';
    Rails.start();

Option 2: enable turbo-rails

Instructions: https://github.com/hotwired/turbo-rails

Recommendation

rails-turbo brings a lot of functionality along with it. I think that this functionality is a useful default for Rails apps in 2023+ but I can see reasonable arguments for taking a more minimal approach. We should make a decision because the current situation makes our devise setup broken out of the box.

@lukeify
Copy link

lukeify commented Sep 8, 2023

Discussed this at rails guild on 8 September. Seems like we're leaning towards turbo-rails. We could also setup turbo to be disabled by default and behind a flag if we didn't want to force turbo on new projects.

@lukeify
Copy link

lukeify commented Sep 22, 2023

We are going to proceed with turbo-rails.

@lukeify lukeify added ruby Pull requests that update Ruby code ready for dev labels Sep 22, 2023
lukeify pushed a commit that referenced this issue Oct 5, 2023
@G-Rath
Copy link
Contributor

G-Rath commented Dec 8, 2023

FYI I've generated a fresh rails app and this is still broken for me - using ujs did work for me though

@G-Rath G-Rath reopened this Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for dev ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants