Today I Learned

hashrocket A Hashrocket project

Start a Rails Console in the Browser

When you generate a new Rails app, it comes with the web-console gem, a handy helper for embedding a rails console in the browser.

This can be useful in development for debugging things in the same process as your webserver. In my case, I used it to test out some action cable related things.

In your controller, just add console to the action -

class AppointmentsController < ApplicationController
  def index
    console
  end
end

image

https://github.com/rails/web-console

See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.