Rails Issue

Rails Issue

ghexerghexer Posts: 3Questions: 1Answers: 1

In my rails app when I load the page with the datatable, everything works great. When i click off of the page with the datatable to a new page and then click the "back" link, it brings me back to the table but without the datatable functionality (no sortable columns, search or pagination). If I then reload, the datatable functionality returns.

This is driving me more than a little crazy. I'm sure its something really stupid that I am missing. Anyone??

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,571Questions: 26Answers: 4,996

    Not sure about the Rails environment but typically when Datatables functionality is missing there is a Javascript error. Have you looked at the browser's console for errors?

    Kevin

  • ghexerghexer Posts: 3Questions: 1Answers: 1

    no errors in console.

  • allanallan Posts: 63,872Questions: 1Answers: 10,527 Site admin

    If you add a debug statement into where you initialise the table, is that being triggered when you go back?

    Allan

  • ghexerghexer Posts: 3Questions: 1Answers: 1
    Answer ✓

    didn't get there - realized my issue was related to turbolinks - specifically turbolinks 5. This fixed me up : https://gorails.com/episodes/upgrade-to-turbolinks-5

  • allanallan Posts: 63,872Questions: 1Answers: 10,527 Site admin

    Thanks for posting back - good to hear you have it working now.

    Allan

This discussion has been closed.