Class: Suspenders::Production::SingleRedirect

Inherits:
Generators::Base
  • Object
show all
Defined in:
lib/suspenders/generators/production/single_redirect.rb

Instance Method Summary collapse

Methods inherited from Generators::Base

default_source_root, inherited

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file

Instance Method Details

#add_rack_canonical_hostObject


6
7
8
9
10
11
12
# File 'lib/suspenders/generators/production/single_redirect.rb', line 6

def add_rack_canonical_host
  inject_into_file(
    "config/environments/production.rb",
    %{\n  config.middleware.use Rack::CanonicalHost, ENV.fetch("APPLICATION_HOST")},
    before: "\nend"
  )
end