# Link\_to problem and I cannot see why

**URL:** <https://discuss.hotwired.dev/t/link-to-problem-and-i-cannot-see-why/4971>\
**Category:** General\
**Created:** [April 15, 2023, 1:31am UTC](https://discuss.hotwired.dev/t/link-to-problem-and-i-cannot-see-why/4971 "2023-04-15T01:31:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlazar](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/dlazar/32/2498_2.png) [@dlazar](https://discuss.hotwired.dev/u/dlazar)\
**Post date:** [April 15, 2023, 1:31am UTC](https://discuss.hotwired.dev/t/link-to-problem-and-i-cannot-see-why/4971/1 "2023-04-15T01:31:44Z")

</div>

I had some code from Rails 7.0.4 running with

“@hotwired/stimulus”: “^3.1.0”,  
“@hotwired/turbo-rails”: “^7.1.3”,

The gist of it was deleting a resource with a custom confirm, copped from a blog post. It worked great! I moved the same link to a different App, running Rails 7.0.4 and

“@hotwired/stimulus”: “^3.2.1”,  
“@hotwired/turbo-rails”: “^7.2.4”,

But the link code no longer works at all. Basically, none of the Turbo events trigger. So my Stimuaus controller is named fine, and so I was thinking this little ditty would just, but nope. My delete link just deletes the resource, happy as a clam, and no confirm ever pops up. Has something changed during these updates and I am just missing out on those changes, making this code broken?

This link works, ie) a confirm from the browser pops up:

```
      <%= link_to "Delete School", "#", data: { "turbo-method": "delete", "turbo-confirm": "Are you sure you want to delete the school?" } %>

```

But this one, ignores Turbo and just deletes the resource! Why?

```
      <%= link_to "Delete Turbo Style", "#", data: { 'turbo-method': "delete", 'school-target': "link", action: "turbo:click->school#captureClick turbo:before-fetch-request@document->school#deleteAndHide" } %>

```

I must be blind. Not getting it. Nothing in my stimulus controller gets hit. No captureClick or deleteAndHide.

I am frustrated!

---

<div class="post-metadata">

**Author:** ![tleish](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/tleish/32/920_2.png) [@tleish](https://discuss.hotwired.dev/u/tleish)\
**Post date:** [April 17, 2023, 4:04pm UTC](https://discuss.hotwired.dev/t/link-to-problem-and-i-cannot-see-why/4971/2 "2023-04-17T16:04:14Z")

</div>

I might suggest temporarily downgrading turbo-rails to the version you know that worked to validate it’s related to the `turbo-rails` and not something else.

---

<div class="post-metadata">

**Author:** ![dlazar](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/dlazar/32/2498_2.png) [@dlazar](https://discuss.hotwired.dev/u/dlazar)\
**Post date:** [April 17, 2023, 6:36pm UTC](https://discuss.hotwired.dev/t/link-to-problem-and-i-cannot-see-why/4971/3 "2023-04-17T18:36:37Z")

</div>

Hmm… yes… that could in fact be a thing I do… thanks. Will report back.

---

<div class="post-metadata">

**Author:** ![Wusinho](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/wusinho/32/3186_2.png) [@Wusinho](https://discuss.hotwired.dev/u/Wusinho)\
**Post date:** [April 19, 2023, 1:25am UTC](https://discuss.hotwired.dev/t/link-to-problem-and-i-cannot-see-why/4971/4 "2023-04-19T01:25:00Z")

</div>

if you want your stimulus to trigger in data : { controller: name\_of\_stimulus, action: ‘action#name\_of\_stimulus’ }

---

<div class="post-metadata">

**Author:** ![dlazar](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/dlazar/32/2498_2.png) [@dlazar](https://discuss.hotwired.dev/u/dlazar)\
**Post date:** [April 19, 2023, 2:30am UTC](https://discuss.hotwired.dev/t/link-to-problem-and-i-cannot-see-why/4971/5 "2023-04-19T02:30:33Z")

</div>

Ya. I would not be writing here if that actually worked… but thanks! I have made a few hundred Stimulus controllers and actions in them, but this is the first time one has failed me with the only thing that has changed (at least in my mind) is the stimulus codebase itself. Hence my question.
