X-Git-Url: https://git.r.bdr.sh/rbdr/grita/blobdiff_plain/396b06b88ac6a3afaf816fe29bce239269c3511e..00ff0af3998fa1592d795a3ba7fa61be5720fd54:/grita.rb?ds=sidebyside diff --git a/grita.rb b/grita.rb index 6e4d367..180fe19 100644 --- a/grita.rb +++ b/grita.rb @@ -17,8 +17,7 @@ get '/' do end post '/' do - @grito = Grito.new(:title => params[:title], :text => params[:text]) - @grito.save + @grito = Grito.create(:title => params[:title], :text => params[:text]) haml :index end @@ -28,7 +27,7 @@ get '/qr/:grito.png' do rpr_filepath = tmpfile.path + '.png' RQR::QRCode.create do |qr| - qr.save('http://grita.heroku.com/'+params[:grito], rpr_filepath) + qr.save('http://#{request.host}/'+params[:grito], rpr_filepath) end buffer = File.open(rpr_filepath).read