ryanb/private_pub — Issue #41: setup problem on simple subscribe
Author: bl4d3
Created: 2012-03-03 11:14:15+00:00
State: open

Hi, I have a problem to biuld up a simple notification system as Ryan has pointed in its railscast.
I have this in my view
```
<%= form_for Bet.new, :remote => true do |f| %>

<%= text_field_tag "bet[auction_id]", auction.id %>
<%= f.submit "Bet" %>

<% end %>
<%= subscribe_to "bets/new" %>
```

this is the create action for bets controller:
```
def create
@auction = Auction.find(params[:bet][:auction_id])
@bet = Bet.new(params[:bet])
@bet.save
end
```
and I have this in create.js.erb
```
<% publish_to "bets/new" do %>
alert("done");
<% end %>
```
I aspect that all the client show the alert, but nothing happen, in my development.log I have
```
Started POST "/bets" for 127.0.0.1 at 2012-03-03 12:12:01 +0100
Processing by BetsController#create as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"6aCKDrymUu2aaRuWO9AIJOR+2p/fo5ZNEdCfBN9w7ZA=", "bet"=>{"auction_id"=>"1"}, "commit"=>"Bet"}
Auction Load (0.4ms) SELECT `auctions`.* FROM `auctions` WHERE `auctions`.`id` = 1 LIMIT 1
(0.1ms) BEGIN
(0.1ms) ROLLBACK
Rendered bets/create.js.erb (3.0ms)
```
Any hint about the issue?
Thanks