jquery - javascript not executed unless reloading page using turbolinks and rails 4 -


I followed it, but I think I can not load "saved token".

I think the problem is that when click on the 'edit' link (made by scaffold),

this does not trigger the preload function, you have problems in Rails 4 How to fix

Enter image details here View page < pre> .form-inputs = f.input: name = F.input: content = f.text_field: user_tokens, data: {load: @ article.users}

my Coffeescript

  $ (document) .ready - & gt; $ ('# Article_user_tokens') TokenInput '/users.json', subject: 'facebook', prePopulate: $ ('# article_user_tokens'). Data ('load')   

requirement css and js file

  * = token-input-focus // requires jquery.tokeninput   

I fix the bug with this solution ready page: load

but I do not understand why this works Is

  $ (document). "Ready Page: Load", - & gt; $ ('# Article_user_tokens') TokenInput '/users.json', subject: 'facebook', prePopulate: $ ('# article_user_tokens'). Data ('load')  

When turboLange is enabled, Instead of using Ajax to load only elements, instead of loading the entire new page for this reason, often the page does not load from the view of jQuery $ (document). Already . See a great post about using .js in Railway 4.

$ (document). 'Ready, page: change' is often used as the option of $ (document). On the page which is not being fully reloaded due to turbo-linux in Rail 4. I think that if you switch to it then your problem should be solved.

Your syntax with a little bit of $ (document). On "Ready Page: Load" Problems are encountered while missing a comma between Ready and Pages and .

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -