Reputation: 9336
I am building a real time chat into a rails 4 application. It seems ActionCable
is the tool for this kind of job.
Is it possible to use ActionCable
in rails 4 or do I have update to rails 5?
I cannot find any introduction for ActionCable
with rails 4.
Upvotes: 11
Views: 5835
Reputation: 1599
Rails, in and of itself, is just a collection of various Rubygems. ActionCable is just a new gem added to the collection with Rails 5. You can install ActionCable by itself via your Gemfile:
gem 'actioncable', '~> 5.0.0.beta3'
Then just go about setting it up. Here is a decent write up on it:
http://www.thegreatcodeadventure.com/rails-5-preview-action-cable/
Upvotes: 8
Reputation: 18444
ActionCable is just a rails-5 way to handle websockets. For current rails there is Faye(https://github.com/faye) with multiple wrappers like private-pub and faye-rails.
Also you do not have to write the websocket handler in ruby at all
Upvotes: 10