Skip to content

Instantly share code, notes, and snippets.

@sihu
Created September 20, 2018 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sihu/9aac0e52f05b8403d264819571394233 to your computer and use it in GitHub Desktop.
Save sihu/9aac0e52f05b8403d264819571394233 to your computer and use it in GitHub Desktop.
````
constraints subdomain: 'bauhaus' do
[['bodenbelaege', 'agb', :de], ['revetements-de-sol', 'cgv', :fr]].each do |route, terms, locale|
get route, to: 'bauhaus_carpets#new', locale: locale
get "#{route}/#{terms}", to: 'bauhaus_carpets#terms', locale: locale
get "#{route}/:code/edit", to: 'bauhaus_carpets#edit', locale: locale
patch "#{route}/:code", to: 'bauhaus_carpets#update', locale: locale
post route, to: 'bauhaus_carpets#create', locale: locale
get "#{route}/:code", to: 'bauhaus_carpets#show', locale: locale
end
=======
%w[bauhaus hornbach].each do |company|
constraints subdomain: company do
[['bodenbelaege', :de], ['revetements-de-sol', :fr]].each do |route, locale|
get route, to: "#{company}_carpets#new", locale: locale
get "#{route}/:code", to: "#{company}_carpets#show", locale: locale
get "#{route}/:code/edit", to: "#{company}_carpets#edit", locale: locale
patch "#{route}/:code", to: "#{company}_carpets#update", locale: locale
post route, to: "#{company}_carpets#create", locale: locale
end
>>>>>>> testing
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment