Skip to content

Instantly share code, notes, and snippets.

@jpemberthy
Forked from diegoeche/posts_controller.rb
Created March 3, 2011 16:13
Show Gist options
  • Save jpemberthy/853016 to your computer and use it in GitHub Desktop.
Save jpemberthy/853016 to your computer and use it in GitHub Desktop.
def create
@post = @huddle.posts.build(params[:post])
@post.user = current_user
deliver_post if @post.save
respond_with @post
end
private
def deliver_post
link = @huddle.id.to_s
puts Pusher[link].trigger('postReceived', @post)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment