Skip to content

Instantly share code, notes, and snippets.

@nslindtner
Created February 5, 2015 08:55
Show Gist options
  • Save nslindtner/8781adb2979eeb3ae29c to your computer and use it in GitHub Desktop.
Save nslindtner/8781adb2979eeb3ae29c to your computer and use it in GitHub Desktop.
Post etoro info from rails app
def create
@etoro = Etoro.new(params[:etoro])
respond_to do |format|
if @etoro.save
uri = URI.parse("https://secure.steamads.com/track/investimonials")
response = Net::HTTP.post_form(uri, {"ip" => "#{request.remote_ip}", "split" => @etoro.split, "value" => @etoro.value, "customer_id" => @etoro.customer_id})
@resp =response
format.html { redirect_to @etoro, notice: 'Etoro was successfully created.' }
format.json { render json: @etoro, status: :created, location: @etoro }
else
format.html { render action: "new" }
format.json { render json: @etoro.errors, status: :unprocessable_entity }
end
end
end
SteamPowered::Application.routes.draw do
resources :etoros
end
create_table "etoros", :force => true do |t|
t.integer "split"
t.integer "value"
t.string "customer_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment