Is there a good way of modifying a route based on the deployment type?
Basically, I have a route that has a :requirements => {:protocol => "https"}, and I'd like that to only happen in production, but not in development.
Is there a good way of modifying a route based on the deployment type?
Basically, I have a route that has a :requirements => {:protocol => "https"}, and I'd like that to only happen in production, but not in development.
You can explicitly define them separately and test for the environment
if Rails.env.production?
map.resources :purchases, :requirements => {:protocol => "https"}
else
map.resources :purchases
end
Note, if you're on older versions of Rails, use ENV['RAILS_ENV'] == production instead