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

Fix delete confirmation with new Rails syntax #1326

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

stanleylhs
Copy link
Member

Fixed Delete confirmation with new Rails syntax
Changed default delete confirmation action from NIL to "Are you sure" translation

@stanleylhs stanleylhs requested a review from steveyken August 20, 2024 10:33
app/helpers/application_helper.rb Fixed Show fixed Hide fixed
app/helpers/application_helper.rb Fixed Show fixed Hide fixed
app/helpers/application_helper.rb Fixed Show fixed Hide fixed

link_to(t(:delete) + "!",
options[:url] || url_for(record),
method: :delete,
remote: true,
confirm: confirm)
data: { confirm: confirm})

Check notice

Code scanning / Rubocop

Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }. Note

Style/HashSyntax: Omit the hash value.

link_to(t(:delete) + "!",
options[:url] || url_for(record),
method: :delete,
remote: true,
confirm: confirm)
data: { confirm: confirm})

Check notice

Code scanning / Rubocop

Use spaces inside hash literal braces - or don't. Note

Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
Copy link
Member

@steveyken steveyken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Yes this restores the functionality to ask for confirmation before completing a destructive action. Code is now compatible with latest rails release.

@steveyken steveyken merged commit ecc721f into master Aug 21, 2024
8 checks passed
@steveyken steveyken deleted the fix-delete-confirm branch August 21, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants