diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index dcf7d08..3a58ed4 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,5 @@ class ApplicationController < ActionController::Base - before_filter :authenticated, :has_info, :create_analytic + before_filter :authenticated, :has_info, :create_analytic, :mailer_options helper_method :current_user, :is_admin?, :sanitize_font # Our security guy keep talking about sea-surfing, cool story bro. @@ -7,6 +7,11 @@ class ApplicationController < ActionController::Base private + def mailer_options + ActionMailer::Base.default_url_options[:protocol] = request.protocol + ActionMailer::Base.default_url_options[:host] = request.host_with_port + end + def current_user @current_user ||= ( User.find_by_auth_token(cookies[:auth_token].to_s) || diff --git a/config/environments/development.rb b/config/environments/development.rb index 9ff11cf..1c25474 100755 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -28,7 +28,7 @@ Railsgoat::Application.configure do # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) config.active_record.auto_explain_threshold_in_seconds = 0.5 - + # Tired of caching causing issues config.middleware.delete Rack::ETag @@ -41,7 +41,6 @@ Railsgoat::Application.configure do # ActionMailer settings for email support config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 } - config.action_mailer.default_url_options = { :host => "localhost:3000" } config.middleware.insert_before( Rack::Lock, Rack::LiveReload,