Bacancy Technology
Bacancy Technology represents the connected world, offering innovative and customer-centric information technology experiences, enabling Enterprises, Associates and the Society to Rise™.
12+
Countries where we have happy customers
1050+
Agile enabled employees
06
World wide offices
12+
Years of Experience
05
Agile Coaches
14
Certified Scrum Masters
1000+
Clients projects
1458
Happy customers
Artificial Intelligence
Machine Learning
Salesforce
Microsoft
SAP
August 12, 2024
When the user clicks on delete, alert not show and go to this path course_path, but don’t delete the course.
def destroy authorize @course @course.destroy respond_to do |format| format.html { redirect_to courses_url, notice: "Course was successfully destroyed." } format.json { head :no_content } end end
= link_to 'Destroy', course, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger
– Rails 7 default use Turbo by default, which changes how form submissions and link interactions work.
So need to change in view
= link_to ‘Destroy’, course, data: {turbo_method: :delete, turbo_confirm: ‘Are you sure?’ }, class: ‘btn btn-sm btn-danger’
Turbo is a set of complementary techniques for speeding up web applications without writing complex JavaScript. It’s part of the Hotwire suite, which aims to provide a modern, HTML-over-the-wire approach to building web applications.