javascript - How can I send text to from one route (/client/1) to another route (/client/2) using ajax in rails? -
i making simple rails (4) application , realize need send text each other sit on different routes (/client/1 , /client/2) without reloading page. got far.
route (/client/1) there input tag , made form rails form helper send xhr request associated controller
in controller, grab text params , assigned variable
i made js file named after action , append variable tag
this working in client/1 cannot figure out how send text route (/client/2).
please me make possible.
i appreciate in advance.
thanks !!
you need streaming mechanism.
first, understand about, suggest watch railscast. it's old 1 explain basic principle of http://railscasts.com/episodes/316-private-pub
then can read pretty article http://www.sitepoint.com/streaming-with-rails-4/
once understand principles, have @ faye , actioncontroller::streaming
Comments
Post a Comment