How to pass variables from Jquery to the view in Rails 4 -


after struggling many hours finding solution pass variables view jquery code, have vice-versa.

is there solution this?

my scenario:

  • 2 values entered in form.
  • values sent api using jquery in view in rails.
  • data api
  • i want publish data in front-end.

any idea? thxs in advance.

use data-attributes

<div id='info' data-info='<%= @varialble.id %>'> $('#info').data('info') in js code 

Comments