0

I have 2 routes an index and an edit route. On the edit route i have an input to initialize as a bootstrap-file input. If i refresh my page on the edit route, the bootstrap-file input is initialized, but if i come from the index page through a link to the edit route, it is not being initialized, how do i do this?

This is the edit page

This is the edit page if coming from the index route

Dee Mid
  • 33
  • 1
  • 4

1 Answers1

0

Please take a look at this question, the user explains it very well.

JQuery gets loaded only on page refresh in Rails 4 application

To fix what rails is doing. Add gem 'jquery-turbolinks' to your gem file and follow the instructions provided on https://github.com/kossnocorp/jquery.turbolinks

Community
  • 1
  • 1
Jon
  • 1,954
  • 1
  • 15
  • 13