My Knowledge Wiki
  • Introduction
  • My Stack
  • Sharing
  • Work
    • How I Want to Work
    • Hiring Process
  • Apps & Tools
    • Raycast
      • Extensions
    • Visual Studio Code
      • Theme
      • Extensions
    • Google Chrome
      • Theme
      • Extensions
    • iTerm 2
      • Theme
    • Fish
      • Plugins
    • Docker
      • Volumes
        • Mounting
    • Web Bundlers
      • Webpack
  • DevOps
    • Databases
      • Estimating Connections
    • Kubernetes
      • Terminology
      • kubectl Cheatsheet
      • Best Practices
      • Application Health Checks
      • Upgrades
      • Troubleshooting
      • Ruby on Rails
  • Awesome Products
  • Engineering Management
    • Overview
  • Software Architecture
    • Microservices
    • Event sourcing
    • Serverless
    • Centralized Authentication
  • Talks
    • Software Architecture
      • An Insider's Look at the Technology That Powers Shopify
      • Building Extensible Platforms
  • Documentation
  • Machine Learning
    • Terminology
    • Regression
    • Overfitting
  • Programming Languages
    • Constructs
    • Go
      • Syntax
    • Ruby
      • Ruby on Rails
        • Setup
        • Gotchas
        • Helpers
        • Libraries
        • Routing
        • Status Code Symbols
      • Debugging
        • Byebug
          • Cheatsheet
      • Libraries
      • Lazy Enumerators
      • Snippets
  • Version Control
    • Git
      • Conventions
        • Conventional Commits
        • gitmoji
  • Education
    • Programming & Computer Science
      • Courses
    • Design
      • Courses and Books
    • Frontend Development
  • HTTP
    • Status Codes
  • Design
    • Icons
      • Icon Sets
  • Arabic Content | محتوى عربي
    • Learning
      • مصادر لتعلم البرمجة و علوم الحاسب
    • Advice
      • إدارة المطورين: نبذة
      • نصائح تصحيح معتقدات خاطئة أمنيات للمبرمجين الجدد
  • Biology
    • Species
      • Ants
Powered by GitBook
On this page
  • Readability
  • Migrations
  • View Helpers
  1. Programming Languages
  2. Ruby
  3. Ruby on Rails

Helpers

PreviousGotchasNextLibraries

Last updated 5 years ago

Readability

  • - Automatically generates attributes as comments at the top of files to see what attributes are in models, fixture files, specs, factories, and more. Example:

    # == Schema Info
    #
    # Table name: line_items
    #
    #  id                  :integer(11)    not null, primary key
    #  quantity            :integer(11)    not null
    #  product_id          :integer(11)    not null
    #  unit_price          :float
    #  order_id            :integer(11)
    #
    
     class LineItem < ActiveRecord::Base
       belongs_to :product
    # ...

Migrations

  • - Detect potentially dangerous migrations and prevent them from running by default, along with instructions on safer ways to do what you want.

  • and for backing Rails enums (which are application-only) by database enums, so people looking at the database can actually understand what all those integer values actually mean.

View Helpers

Rails already provides a ton of view helpers (e.g. number_to_currency), they're listed .

annotate_models
strong_migrations
native_enum
activerecord-postgres_enum
here