Skip to content

Instantly share code, notes, and snippets.

@DylanLacey
Created May 5, 2011 09:23
Show Gist options
  • Save DylanLacey/956779 to your computer and use it in GitHub Desktop.
Save DylanLacey/956779 to your computer and use it in GitHub Desktop.
def submit
@job = Job.find(params[:id], :include => [:pickup_addresses, :setdown_addresses])
@dispatch_result = false
AMQP.start("amqp://guest:guest@localhost:5672") do |connection, open_ok|
puts "BLOCK"
AMQP::Channel.new(connection) do |channel, open_c_ok|
puts "OPENED CHANNEL"
end
puts "CLOSEBLOCK"
end
respond_to do |format|
if @dispatch_result
format.html { redirect_to(@job, :notice => 'Job was successfully dispatched.') }
else
format.html { redirect_to(@job, :notice => 'Job was fail dispatched.') }
format.xml { render :xml => @job, :status => :created, :location => @job }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment