# Stimulus and Rails UJS

**URL:** <https://discuss.hotwired.dev/t/stimulus-and-rails-ujs/587>\
**Category:** General\
**Created:** [December 21, 2018, 5:06pm UTC](https://discuss.hotwired.dev/t/stimulus-and-rails-ujs/587 "2018-12-21T17:06:55Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![kaspermeyer](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/kaspermeyer/32/483_2.png) [@kaspermeyer](https://discuss.hotwired.dev/u/kaspermeyer)\
**Post date:** [February 21, 2019, 2:28pm UTC](https://discuss.hotwired.dev/t/stimulus-and-rails-ujs/587/7 "2019-02-21T14:28:09Z")

</div>

You can have an action that triggers on ajax success like so:

```auto
<form data-action="ajax:success->controller-name#actionName">

```

A complete list of ajax lifecycle events can be found here: [https://edgeguides.rubyonrails.org/working\_with\_javascript\_in\_rails.html#rails-ujs-event-handlers](https://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html#rails-ujs-event-handlers)

---

_[View the full topic](https://discuss.hotwired.dev/t/stimulus-and-rails-ujs/587)._
