rails-guides

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rails Guides

Rails 指南

Official Rails documentation for reference during development.
开发过程中可供参考的官方Rails文档。

Topic Map

主题目录

Getting Started

入门指南

  • references/getting_started.md
    — Rails basics, MVC overview, first app walkthrough
  • references/command_line.md
    rails
    command, generators, rake tasks
  • references/configuring.md
    — Environments, initializers, credentials, database.yml
  • references/autoloading_and_reloading_constants.md
    — Zeitwerk, module naming, reload behavior
  • references/initialization.md
    — Rails boot sequence, railties, engines
  • references/getting_started.md
    — Rails基础、MVC概览、首个应用实操教程
  • references/command_line.md
    rails
    命令、生成器、rake任务
  • references/configuring.md
    — 环境配置、初始化器、凭证、database.yml
  • references/autoloading_and_reloading_constants.md
    — Zeitwerk、模块命名、重载行为
  • references/initialization.md
    — Rails启动流程、railties、引擎

Active Record

Active Record

  • references/active_record_basics.md
    — Models, CRUD, conventions, migrations
  • references/active_record_querying.md
    — Finders, scopes, joins, includes, explain
  • references/active_record_validations.md
    — Built-in validators, custom validators, errors
  • references/active_record_callbacks.md
    — Lifecycle hooks, after_commit, skip_callback
  • references/association_basics.md
    — belongs_to, has_many, has_one, HABTM, polymorphic
  • references/active_record_migrations.md
    — Schema changes, reversible migrations, db:migrate
  • references/active_record_encryption.md
    — Encrypting attributes at rest
  • references/active_record_composite_primary_keys.md
    — Multi-column primary keys
  • references/active_record_multiple_databases.md
    — Multi-DB setup, sharding, replicas
  • references/active_record_postgresql.md
    — PostgreSQL-specific features (hstore, jsonb, arrays)
  • references/active_model_basics.md
    — ActiveModel outside ActiveRecord, form objects
  • references/active_record_basics.md
    — 模型、CRUD、约定规则、迁移
  • references/active_record_querying.md
    — 查找器、作用域、连接查询、预加载、执行计划解释
  • references/active_record_validations.md
    — 内置验证器、自定义验证器、错误处理
  • references/active_record_callbacks.md
    — 生命周期钩子、after_commit、跳过回调
  • references/association_basics.md
    — belongs_to、has_many、has_one、HABTM、多态关联
  • references/active_record_migrations.md
    — Schema变更、可逆迁移、db:migrate
  • references/active_record_encryption.md
    — 静态属性加密
  • references/active_record_composite_primary_keys.md
    — 多列主键
  • references/active_record_multiple_databases.md
    — 多数据库配置、分库、只读副本
  • references/active_record_postgresql.md
    — PostgreSQL专属特性(hstore、jsonb、数组)
  • references/active_model_basics.md
    — 独立于ActiveRecord的ActiveModel、表单对象

Action Controller

Action Controller

  • references/action_controller_overview.md
    — Controllers, params, filters, sessions, cookies
  • references/action_controller_advanced_topics.md
    — Streaming, live, metal, http auth
  • references/routing.md
    — Resources, namespaces, constraints, named routes, URL helpers
  • references/action_controller_overview.md
    — 控制器、参数、过滤器、会话、Cookie
  • references/action_controller_advanced_topics.md
    — 流式传输、实时响应、Metal、HTTP身份验证
  • references/routing.md
    — 资源路由、命名空间、路由约束、命名路由、URL辅助方法

Action View

Action View

  • references/action_view_overview.md
    — Templates, partials, layouts, formats
  • references/action_view_helpers.md
    — form_with, link_to, tag, content_tag, asset helpers
  • references/form_helpers.md
    — form_with, field helpers, nested forms, uploads
  • references/layouts_and_rendering.md
    — render, redirect_to, respond_to, layout inheritance
  • references/action_view_overview.md
    — 模板、局部模板、布局、格式
  • references/action_view_helpers.md
    — form_with、link_to、tag、content_tag、资源辅助方法
  • references/form_helpers.md
    — form_with、字段辅助方法、嵌套表单、文件上传
  • references/layouts_and_rendering.md
    — render、redirect_to、respond_to、布局继承

Frontend / Hotwire

前端 / Hotwire

  • references/working_with_javascript_in_rails.md
    — Import maps, Turbo, Stimulus overview
  • references/action_text_overview.md
    — Rich text with Trix, attachments
  • references/working_with_javascript_in_rails.md
    — 导入映射、Turbo、Stimulus概览
  • references/action_text_overview.md
    — 基于Trix的富文本、附件功能

Jobs & Mailers

任务与邮件程序

  • references/active_job_basics.md
    — Job classes, queues, retry, test helpers
  • references/action_mailer_basics.md
    — Mailers, templates, deliveries, previews
  • references/action_mailbox_basics.md
    — Incoming email routing and processing
  • references/active_job_basics.md
    — 任务类、队列、重试、测试辅助方法
  • references/action_mailer_basics.md
    — 邮件程序、模板、发送配置、预览
  • references/action_mailbox_basics.md
    — 入站邮件路由与处理

Storage

存储

  • references/active_storage_overview.md
    — File uploads, variants, direct uploads, S3/GCS/Azure
  • references/active_storage_overview.md
    — 文件上传、变体、直传、S3/GCS/Azure支持

Testing

测试

  • references/testing.md
    — Minitest, fixtures, test types, helpers, assertions
  • references/testing.md
    — Minitest、固件、测试类型、辅助方法、断言

Real-Time

实时功能

  • references/action_cable_overview.md
    — WebSockets, channels, broadcasting, connections
  • references/action_cable_overview.md
    — WebSockets、频道、广播、连接

Security & Performance

安全与性能

  • references/security.md
    — SQL injection, XSS, CSRF, mass assignment, secure headers
  • references/caching_with_rails.md
    — Fragment, action, HTTP caching, cache stores
  • references/asset_pipeline.md
    — Sprockets, Propshaft, precompile, digests
  • references/tuning_performance_for_deployment.md
    — Puma, connection pooling, GC
  • references/security.md
    — SQL注入、XSS、CSRF、批量赋值、安全响应头
  • references/caching_with_rails.md
    — 片段缓存、动作缓存、HTTP缓存、缓存存储
  • references/asset_pipeline.md
    — Sprockets、Propshaft、预编译、摘要
  • references/tuning_performance_for_deployment.md
    — Puma、连接池、垃圾回收优化

Internationalization

国际化

  • references/i18n.md
    — Translation files, locale, pluralization, date formats
  • references/i18n.md
    — 翻译文件、区域设置、复数规则、日期格式

API & Rack

API & Rack

  • references/api_app.md
    — API-only Rails, slim middleware stack
  • references/rails_on_rack.md
    — Middleware stack, Rack integration
  • references/api_app.md
    — 仅API模式的Rails、精简中间件栈
  • references/rails_on_rack.md
    — 中间件栈、Rack集成

Advanced

高级功能

  • references/active_support_core_extensions.md
    — String, Array, Hash, Date extensions
  • references/active_support_instrumentation.md
    — Notifications, log subscribers
  • references/association_basics.md
    — Association options, eager loading strategies
  • references/debugging_rails_applications.md
    — debug gem, logger, web-console, byebug
  • references/error_reporting.md
    — Error::Reporter, Sentry integration
  • references/threading_and_code_execution.md
    — Thread safety, executor, reloader
  • references/upgrading_ruby_on_rails.md
    — Version upgrade paths, deprecation handling
  • references/active_support_core_extensions.md
    — String、Array、Hash、Date扩展方法
  • references/active_support_instrumentation.md
    — 事件通知、日志订阅器
  • references/association_basics.md
    — 关联选项、预加载策略
  • references/debugging_rails_applications.md
    — debug gem、日志器、web-console、byebug
  • references/error_reporting.md
    — Error::Reporter、Sentry集成
  • references/threading_and_code_execution.md
    — 线程安全、执行器、重载器
  • references/upgrading_ruby_on_rails.md
    — 版本升级路径、弃用处理