Skip to content

Instantly share code, notes, and snippets.

View pinzonjulian's full-sized avatar
🤘

Julián Pinzón Eslava pinzonjulian

🤘
View GitHub Profile

The Unofficial 37signals/DHH Rails Style Guide

About This Document

This style guide was generated by Claude Code through deep analysis of the Fizzy codebase - 37signals' open-source project management tool.

Why Fizzy matters: While 37signals has long advocated for "vanilla Rails" and opinionated software design, their production codebases (Basecamp, HEY, etc.) have historically been closed source. Fizzy changes that. For the first time, developers can study a real 37signals/DHH-style Rails application - not just blog posts and conference talks, but actual production code with all its patterns, trade-offs, and deliberate omissions.

How this was created: Claude Code analyzed the entire codebase - routes, controllers, models, concerns, views, JavaScript, CSS, tests, and configuration. The goal was to extract not just what patterns are used, but why - inferring philosophy from implementation choices.

@pinzonjulian
pinzonjulian / application.html.erb
Last active April 16, 2023 02:50
Application layout: full on spaghetti!
<!DOCTYPE html>
<html>
<head>
<!-- ... -->
</head>
<body>
<%= if current_user.signed_in? %>
<%= if current_page?(booking_rides_path) %>
<% end %>
class ExampleFormBuilder < ActionView::Helpers::FormBuilder
def error(method, error_text = nil, options = {})
return if errors_blank?(method) && error_text.blank?
text = if error_text
error_text
elsif object.errors.custom_messages_for(method)
object.errors.custom_messages_for(method).to_sentence
else
object.errors.full_messages_for(method).to_sentence
# UNEXPECTED BEHAVIOUR
class User < ApplicationRecord
has_many :client_posts,
class_name: Client::Post.name,
foreign_key: :user_id
end
class Client::Post < ApplicationRecord
# Note how the class_name is declared here
@pinzonjulian
pinzonjulian / admin_tangled_example.ruby
Created January 22, 2018 04:26
Organizing an app in Ruby on Rails
class OrdersController < ApplicationController
def new
# some cool code
end
def create
# some cool code
end