-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from briri/master
Added the optional locale scope to the config/routes.rb file. Added a…
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
Rails.application.routes.draw do | ||
resources :contacts, | ||
:controller => 'contact_us/contacts', | ||
:only => [:new, :create] | ||
get 'contact-us' => 'contact_us/contacts#new', :as => :contact_us | ||
# Place the contact_us routes within the optional locale scope | ||
# If the I18n gem is installed and the localize_routes variable has | ||
# been set to true in the application's initializer file | ||
if defined?(I18n) && ContactUs.localize_routes | ||
scope "(:locale)", locale: /#{I18n.available_locales.join("|")}/ do | ||
resources :contacts, | ||
controller: "contact_us/contacts", | ||
only: [:new, :create] | ||
|
||
get "contact-us" => "contact_us/contacts#new", as: :contact_us | ||
end | ||
|
||
else | ||
resources :contacts, | ||
controller: "contact_us/contacts", | ||
only: [:new, :create] | ||
|
||
get "contact-us" => "contact_us/contacts#new", as: :contact_us | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters