How to disable “Cannot Render Console from…” on Rails

后端 未结 11 1317
心在旅途
心在旅途 2020-12-07 10:35

I\'m using Ubuntu/vagrant as my development environment. I\'m getting these messages on rails console:

Started GET \"/assets/home-fcec5b5a277ac7c20cc9f45a209         


        
11条回答
  •  甜味超标
    2020-12-07 10:42

    You can whitelist single IP's or whole networks.

    Say you want to share your console with 192.168.0.100. You can do this:

    class Application < Rails::Application
      config.web_console.whitelisted_ips = '192.168.0.100'
    end
    

    If you want to whitelist the whole private network, you can do:

    class Application < Rails::Application
      config.web_console.whitelisted_ips = '192.168.0.0/16'
    end
    

    If you don't wanna see this message anymore, set this option to false:

    class Application < Rails::Application
      config.web_console.whiny_requests = false
    end
    

    Be careful what you wish for, 'cause you might just get it all

    This is probably only for development purposes so you might prefer to place it under config/environments/development.rb instead of config/application.rb.

提交回复
热议问题