开发者

Restrict routes by environment

开发者 https://www.devze.com 2023-03-31 07:43 出处:网络
We (me and all my personalities, of course) have several routes we\'d like to not expose in production but we use in development and testing. I开发者_C百科 know you can (or could?) add a before filter

We (me and all my personalities, of course) have several routes we'd like to not expose in production but we use in development and testing. I开发者_C百科 know you can (or could?) add a before filter in the controller to lock down these things depending upon environment, but can this be done from config/routes.rb?

thanks


Have you tried:

if Rails.env.development?
   resources :secrets
end

As I understand the router, that should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号