CDRH / family_letters

Family Letters Rails Site
https://familyletters.unl.edu
0 stars 0 forks source link

Eliminate the possibility of accessing the same data from two URL's #28

Closed karindalziel closed 5 years ago

karindalziel commented 5 years ago

i.e. https://cdrhdev1.unl.edu/family_letters/explore and https://cdrhdev1.unl.edu/family_letters/es/explore (orchid)

I'm guessing we'll always want to forward to the default language.

jduss4 commented 5 years ago

Maybe what we ought to do is say if there is a default language, then that locale is not allowed through as a parameter? I don't know if this would work, because I don't remember off the top of my head how the optional parameter thing worked at this point in the game, but I think maybe if we had the languages es|en|de selected in the preferences, and default language es, then perhaps we could set something like:

          locales: /en|de/
          scope "(:locale)", locale: locales do
            ROUTES.each do |route|
              next if drawn_routes.include?(route[:name])

              # Call routing DSL methods in Orchid route procs in this context
              instance_eval(&route[:definition])
            end
          end

Theoretically that might mean that es/search was no longer allowed, but search, en/search, and de/search would be...and it would also mean that apps with only one language would be good to go

jduss4 commented 5 years ago

Closed with https://github.com/CDRH/orchid/pull/104