Skip to content

Latest commit

 

History

History
129 lines (101 loc) · 2.41 KB

File metadata and controls

129 lines (101 loc) · 2.41 KB

Rails Console Pro - Quick Start Guide

Installation

  1. Add to Gemfile:

    gem 'rails_console_pro'
  2. Install:

    bundle install
  3. Start Rails Console:

    rails console

That's it! The gem automatically loads and enhances your console.

Quick Examples

Schema Inspection

schema User

Learn more →

SQL Explain

explain User.where(active: true)

Learn more →

Model Statistics

stats User

Learn more →

Association Navigation

navigate User

Learn more →

Object Diffing

user1 = User.first
user2 = User.last
diff user1, user2

Learn more →

Export

export schema(User) user_schema.json

Learn more →

Model Introspection

introspect User
introspect User, :callbacks
introspect User, :enums

Learn more →

Snippet Library

snippets(:add, "User.where(active: true).count", description: "Active users", tags: %w[users metrics])
snippets(:list)

Learn more →

Beautiful Formatting

User.first  # Automatically formatted with colors

Learn more →

Configuration (Optional)

Create config/initializers/rails_console_pro.rb:

RailsConsolePro.configure do |config|
  # Color scheme
  config.color_scheme = :dark  # or :light
  
  # Welcome message
  config.show_welcome_message = true
  
  # Pagination
  config.pagination_enabled = true
  config.pagination_threshold = 10
  config.pagination_page_size = 5
end

Or use the generator:

rails generate rails_console_pro:install

Requirements

  • Ruby >= 3.0.0
  • Rails >= 6.0
  • Pry >= 0.14.0 (recommended)

Documentation

Need Help?