Permalink
Browse files

getting squishee to work

  • Loading branch information...
1 parent 712bab1 commit 886f3f8cb88a6994966ff2cfc2f302c09e0bd892 Daniel Dosen committed Apr 27, 2012
Showing with 12 additions and 1 deletion.
  1. +1 −1 app/controllers/squishee_cups_controller.rb
  2. +11 −0 app/models/squishee_cup.rb
@@ -57,7 +57,7 @@ def create
# PUT /squishee_cups/1.json
def update
@squishee_cup = SquisheeCup.find(params[:id])
-
+ puts params.to_json
respond_to do |format|
if @squishee_cup.update_attributes(params[:squishee_cup])
format.html { redirect_to @squishee_cup, notice: 'Squishee cup was successfully updated.' }
View
@@ -1,3 +1,14 @@
+require "net/http"
+
class SquisheeCup < ActiveRecord::Base
+
attr_accessible :color, :name
+
+ after_commit do
+ req = Net::HTTP::Put.new("/squishee_cups/#{id}.json")
+ req.body = to_json
+ Net::HTTP.start('0.0.0.0', 7474).request(req)
+ end
+
+
end

0 comments on commit 886f3f8

Please sign in to comment.