function(e) { e.preventDefault(); dispatcher.trigger('new_message', { text: text }); this.props.createMessage({ text: text }); }, render: function() { return ( <form className="comment-form" onSubmit={this.onSubmit}> <textarea placeholder="write something..." ref="text"/> <input type="submit" value="submit" /> </form> ); } }); WebSocket ʹΠϕϯτΛ௨ WebSocket Ͱαʔόʔଆ ʹ௨͢Δ Rails ͷ api Λ ajax Ͱୟ͘