Skip to content

Instantly share code, notes, and snippets.

@buren
Last active February 13, 2016 18:16
Show Gist options
  • Save buren/c408bc0b22da3e3f3080 to your computer and use it in GitHub Desktop.
Save buren/c408bc0b22da3e3f3080 to your computer and use it in GitHub Desktop.
Attach a rails web console to any page by adding ?web_console=
# config/initializers/web_console.rb
WebConsoleBeforeAction = ->(controller) do
controller.console if controller.params[:web_console]
end
ApplicationController.before_action(WebConsoleBeforeAction) if defined?(WebConsole) && Rails.env.development?
# NOTE:
# For security reasons only do this in development.
@GiaoGiaoCat
Copy link

Cool, tks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment