Skip to content

Instantly share code, notes, and snippets.

@danopia
Forked from relrod/gist:129558
Created June 14, 2009 05:19
Show Gist options
  • Save danopia/129559 to your computer and use it in GitHub Desktop.
Save danopia/129559 to your computer and use it in GitHub Desktop.
def create
@bit = Bit.new(params[:bit])
@bit.IP = request.remote_ip
respond_to do |format|
if @bit.save
flash[:notice] = 'Bit was successfully created.'
#cookies[:bitbin] = { :value => @bit.id.to_i, :expires => Time.now + 3600}
format.html { redirect_to(@bit) }
format.xml { render :xml => @bit, :status => :created, :location => @bit }
else
format.html { render :action => "new" }
format.xml { render :xml => @bit.errors, :status => :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment