From 56e1c2c8a4ff8a1047d1a6a92834afed1b8b6a9e Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 4 Jan 2016 21:40:26 -0500 Subject: [PATCH] Fixed routes and paths --- app/controllers/qbo_controller.rb | 4 ++-- app/views/qbo/_settings.html.erb | 2 +- config/routes.rb | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/qbo_controller.rb b/app/controllers/qbo_controller.rb index ac2712e..fec800b 100644 --- a/app/controllers/qbo_controller.rb +++ b/app/controllers/qbo_controller.rb @@ -30,7 +30,7 @@ class QboController < ApplicationController # Called when the user requests that Redmine to connect to QBO # def authenticate - callback = "https://rickbarrette.org/redmine/oauth_callback" + callback = request.base_url + qbo_oauth_callback_path token = $qb_oauth_consumer.get_request_token(:oauth_callback => callback) session[:qb_request_token] = token redirect_to("https://appcenter.intuit.com/Connect/Begin?oauth_token=#{token.token}") and return @@ -58,7 +58,7 @@ class QboController < ApplicationController if qbo.save! redirect_to plugin_settings_path(:redmine_qbo), :flash => { :notice => "Successfully connected to Quickbooks" } else - redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Errorn_settings_path" } + redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" } end end diff --git a/app/views/qbo/_settings.html.erb b/app/views/qbo/_settings.html.erb index 8daa7d6..199fab7 100644 --- a/app/views/qbo/_settings.html.erb +++ b/app/views/qbo/_settings.html.erb @@ -55,4 +55,4 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI Note: You need to authenticate after saving your key and secret above
-<%= link_to "Authenticate", authenticate_path, :method => :get %> +<%= link_to "Authenticate", qbo_authenticate_path, :method => :get %> diff --git a/config/routes.rb b/config/routes.rb index 1e07f6c..04381eb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,7 +12,7 @@ # See: http://guides.rubyonrails.org/routing.html # -get 'authenticate', :to => 'qbo#authenticate' -get 'oauth_callback', :to => 'qbo#oauth_callback' +get 'qbo/authenticate', :to => 'qbo#authenticate' +get 'qbo/oauth_callback', :to => 'qbo#oauth_callback' - get 'qbo_sync', :to => 'qbo#sync' +get 'qop/qbo_sync', :to => 'qbo#sync'