rails-docs
Offline Ruby on Rails reference — the official Rails Guides and core API class docs bundled as on-demand markdown. Use when working in a Rails app or answering Rails questions: Active Record (migratio
SKILL.md.claude/skills/railsguide/SKILL.md
GitHubRuby on Rails Reference
Bundled, offline snapshot of the official Rails documentation:
references/guides/— 54 Rails Guides (the conceptual "how Rails works" docs)references/api/— 80 core API class pages from api.rubyonrails.org (signatures, methods, options)references/overview.md— the Rails framework overview (what each component does)
Source: crawled from guides.rubyonrails.org and api.rubyonrails.org. Treat these files as the source of truth for Rails behavior, defaults, and method signatures. When a question is answerable from a bundled file, load that file with Read instead of fetching the web or answering from memory — Rails defaults change between versions and the bundled docs are the snapshot in hand.
How to use this skill
- Identify the Rails component/topic from the user's question (the map below).
Readthe matchingreferences/guides/<file>for concepts/behavior, and/orreferences/api/<Class>.mdfor exact method signatures and options.- Quote/apply the specific behavior; cite the guide name. Don't paraphrase from recall when the file is right here.
If unsure which component owns a concept, read references/overview.md first — it summarizes the responsibility of each Rails framework (Model/View/Controller layers + Action Mailer, Active Job, Action Cable, Active Storage, Action Text, Active Support).
Topic → guide map
Getting started / project setup
getting_started.md— first app, full walkthroughinstall_ruby_on_rails.md,development_dependencies_install.md— installationcommand_line.md—rails/rakecommands, runners, consolesconfiguring.md— config files, initializers,config.*optionsgenerators.md— writing and customizing generators
Models — Active Record (load references/api/ActiveRecord_*.md for signatures)
active_record_basics.md— models, CRUD, conventions → API:ActiveRecord_Base.md,ActiveRecord_Persistence.md,ActiveRecord_Core.mdactive_record_migrations.md— schema changes → API:ActiveRecord_Migration.mdactive_record_validations.md— validations → API:ActiveRecord_Validations.md,ActiveModel_Validations.md,ActiveModel_Errors.mdactive_record_callbacks.md— lifecycle hooks → API:ActiveRecord_Callbacks.mdassociation_basics.md— has_many/belongs_to/etc. → API:ActiveRecord_Associations.md,ActiveRecord_Associations_ClassMethods.md,ActiveRecord_NestedAttributes.mdactive_record_querying.md— query interface → API:ActiveRecord_FinderMethods.md,ActiveRecord_Scoping.md,ActiveRecord_Sanitization.mdactive_record_multiple_databases.md— multi-DB → API:ActiveRecord_ConnectionHandling.mdactive_record_composite_primary_keys.md,active_record_encryption.md(→ActiveRecord_Encryption_EncryptableRecord.md),active_record_postgresql.md- Transactions/locking → API:
ActiveRecord_Transactions.md,ActiveRecord_Locking_Optimistic.md,ActiveRecord_Locking_Pessimistic.md active_model_basics.md— Active Model for non-DB objects → API:ActiveModel_API.md,ActiveModel_AttributeMethods.md,ActiveModel_Dirty.md,ActiveModel_Serialization.md
Views — Action View
action_view_overview.md,action_view_helpers.md— templates and helperslayouts_and_rendering.md— render/redirect/layoutsform_helpers.md— form_with, form builders, nested forms
Controllers — Action Controller
action_controller_overview.md— params, sessions, filters, strong params → API:ActionController_Base.md,ActionController_Parameters.mdaction_controller_advanced_topics.md— streaming, rescue, etc.routing.md— the router, resources, constraints- Sessions/cookies → API:
ActionDispatch_Session_CookieStore.md
Other framework components
action_mailer_basics.md,action_mailbox_basics.md— outbound/inbound emailaction_text_overview.md— rich textaction_cable_overview.md— WebSocketsactive_job_basics.md— background jobsactive_storage_overview.md— file attachmentsactive_support_core_extensions.md,active_support_instrumentation.md— Active Support helpers + instrumentation eventsworking_with_javascript_in_rails.md,asset_pipeline.md— front-end assets, import maps
Cross-cutting concerns
i18n.md— internationalizationsecurity.md— security guide (CSRF, mass assignment, injection)caching_with_rails.md— fragment/Russian-doll cachingerror_reporting.md,debugging_rails_applications.md— diagnosticsautoloading_and_reloading_constants.md— Zeitwerk autoloadingthreading_and_code_execution.md— concurrency, the executor/reloadersign_up_and_settings.md— built-in authentication generator example
Testing
testing.md— the full testing guide (model/controller/system/integration tests, fixtures)
Deploy / maintain / extend
tuning_performance_for_deployment.md— app servers, threads, YJIT, poolingupgrading_ruby_on_rails.md,maintenance_policy.md— version upgrades and support windowsengines.md,plugins.md,rails_on_rack.md,initialization.md— extending Rails internalsapi_app.md— API-only Rails apps
Contributing to Rails (only when the task is patching Rails itself)
contributing_to_ruby_on_rails.md,api_documentation_guidelines.md,ruby_on_rails_guides_guidelines.md
Notes & limits
- Snapshot, not live. These are crawled at a point in time (Rails ~8.x edge guides). For a version-specific question, confirm the target Rails version; if it differs materially, note that the bundled snapshot may not match and fall back to a targeted web fetch.
- API coverage is partial.
references/api/holds the most-used Active Record / Active Model / Action Controller classes (depth-2 from the API index), not the entire API tree. If a needed class isn't bundled, the guides usually cover the behavior; otherwise fetchhttps://api.rubyonrails.org/classes/<Class>.html. - Don't dump whole files into context. These guides are large.
Readthe single relevant file (and useoffset/limitor grep within it) rather than loading several at once.