From 2cdb5a756d327eff72d50a4720192b2c1d56f22e Mon Sep 17 00:00:00 2001 From: chris2tof Date: Mon, 22 Aug 2011 14:01:51 +0800 Subject: [PATCH] Set store_ip in config.yml --- app/controllers/admin/purchases_controller.rb | 2 +- app/views/admin/sites/index.html.erb | 2 +- config/config.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/purchases_controller.rb b/app/controllers/admin/purchases_controller.rb index f11cc414..56f3dbaa 100644 --- a/app/controllers/admin/purchases_controller.rb +++ b/app/controllers/admin/purchases_controller.rb @@ -20,7 +20,7 @@ class Admin::PurchasesController < ApplicationController protected def download_purchase(purchase, url) - uri = URI.parse("http://localhost:3001/download/design") + uri = URI.parse("http://#{APP_CONFIG['store_ip']}/download/design") http = Net::HTTP.new(uri.host, uri.port) request = Net::HTTP::Post.new(uri.request_uri) diff --git a/app/views/admin/sites/index.html.erb b/app/views/admin/sites/index.html.erb index bd12502a..80931f91 100644 --- a/app/views/admin/sites/index.html.erb +++ b/app/views/admin/sites/index.html.erb @@ -1,7 +1,7 @@ <% if @site && @site.registered? %> registered <% else %> - <%= link_to 'register', 'http://localhost:3001/user/sites/register?' + + <%= link_to 'register', "http://#{APP_CONFIG['store_ip']}/user/sites/register?" + {:site => {:school => @site.school, :department => @site.department}}.to_query, :target => '_blank' %> <% end %> \ No newline at end of file diff --git a/config/config.yml b/config/config.yml index 6a8bdb92..77e030de 100644 --- a/config/config.yml +++ b/config/config.yml @@ -1,5 +1,6 @@ defaults: &defaults main_public_key: 'lib/main_public_key.pem' + store_ip: 'localhost:3001' development: <<: *defaults \ No newline at end of file