Created
May 5, 2011 09:23
-
-
Save DylanLacey/956779 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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