posted 9 years ago
I've got this in a js.coffee file in my tutorial web app:
This makes a particular post, called a status, change color and display links to edit or delete the post. It only works when the page is first loaded into the browser as the index page, or when redirected to as root_url by the sign_out action. When the same page is loaded by clicking on a link using statuses_path, nothing happens when you mouse over the statuses. It's the same page, with the same url, but the script doesn't work after clicking one of the links. If I reload the page, or sign in and then sign out, the script works.
I didn't notice this problem until I decided to scratch devise and do the authentication from scratch, so I could add custom fields to the form that actually worked. I got the authentication working okay, but I can't figure out what is going on with this script. It seems to me that the same page should work the same, regardless of how you got there, but obviously I'm missing something here.
What can I do to correct this?