Class: TranslationCms::Routers::FreeQuoteRouter

Inherits:
Object
  • Object
show all
Defined in:
lib/translation_cms/routers/free_quote_router.rb

Class Method Summary collapse

Class Method Details

.loadObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/translation_cms/routers/free_quote_router.rb', line 7

def load
  Rails.application.routes.draw do
    if Structure.table_exists? && (root = Structure.with_type(StructureType.free_quote).first)
      localized do
        scope root.slug do
          scope format: false, defaults: { format: 'html' } do
            get '', to: 'free_quote#new', as: 'free_quote'
            get 'success', to: 'free_quote#success', as: 'free_quote_success'
          end
          post 'send', to: 'free_quote#create', as: 'send_free_quote',
                       format: true, constraints: { format: :json }
        end
      end
    end
  end
end

.reloadObject



24
25
26
# File 'lib/translation_cms/routers/free_quote_router.rb', line 24

def reload
  Rails.application.routes_reloader.reload!
end