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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -