Open kaid opened 10 years ago
首先启动faye服务,在layout/application.html.haml里引用faye.js.coffee
layout/application.html.haml
faye.js.coffee
然后在simple_page_layout的block里加入如下代码
simple_page_layout
- if user_signed_in? .page-chat-bar{:data => {:'user-id' => current_user.id, :'user-name' => current_user.name}} .contacts - User.limit(20).where('id <> ?', current_user.id).each do |user| .user{:data => {:id => user.id, :name => user.name}} .avatar= avatar user, :small .chat-box .headbar .avatar .contact %span 和 %span.name %span 聊天 .chatlog .inputer %textarea.ipt %a.btn.success.small.send{:href => 'javascript:;'} 发送
首先启动faye服务,在
layout/application.html.haml
里引用faye.js.coffee
然后在
simple_page_layout
的block里加入如下代码