Use of Gon Gem with Javascript & Rails
Using Rails data as a part of javascript is an extremely regular need, particularly for Javascript applications such as Angular, Ember and SPA. If it is a small amount of data, we can directly assign it to the ruby variables. From rails view:Ex:- HTML: ; $(‘#user’).val(); HTML data attribute: <%= content_tag “div”, id: “posts”, data: …