diff --git a/app/controllers/api_keys_controller.rb b/app/controllers/api_keys_controller.rb index 9653962..905a37c 100644 --- a/app/controllers/api_keys_controller.rb +++ b/app/controllers/api_keys_controller.rb @@ -8,7 +8,7 @@ class ApiKeysController < ApplicationController end def destroy - current_user.api_keys.find_by_api_key(params[:id]).try(:destroy) + current_user.api_keys.find_by_api_key(params[:id].to_s).try(:destroy) redirect_to :back end @@ -34,7 +34,7 @@ class ApiKeysController < ApplicationController end def update - @api_key = current_user.api_keys.find_by_api_key(params[:id]) + @api_key = current_user.api_keys.find_by_api_key(params[:id].to_s) @api_key.update_attributes(api_key_params) redirect_to :back end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 96ada82..bdec2d1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -201,7 +201,7 @@ class ApplicationController < ActionController::Base def get_apikey key = get_header_value(HTTP_HEADER_API_KEY_NAME) || params[:key] || params[:api_key] || params[:apikey] key.strip if key.present? - return key + return key.to_s end # get specified header value