![](https://dhampik.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBGZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0844eb021f61beec2b455025f7c6928df8de93b7/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBPZ2h3Ym1jNkVuSmxjMmw2WlY5MGIxOW1hWFJiQjJrQmdHa0JnQT09IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--97dc6d68b366554a9907e9783c9a0c17c15569ec/passing-data-to-js.png)
Sometimes it is required to pass some data from server-side code to client-side javascript code.
There is a gon gem for that and it has pretty good manual. Nevertheless, I had some issues using this gem, so I decided to share my experience.
Sometimes it is required to pass some data from server-side code to client-side javascript code.
There is a gon gem for that and it has pretty good manual. Nevertheless, I had some issues using this gem, so I decided to share my experience.