Skip to content

Home page: make the admin sample run as shown, and fit it at 320px - #65

Merged
nesquena merged 5 commits into
masterfrom
admin-sample-migrate-note
Nov 19, 2026
Merged

nesquena merged 5 commits into
masterfrom
admin-sample-migrate-note

Conversation

@nesquena

@nesquena nesquena commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The home page's admin terminal sample now runs as written, in order, on Padrino 0.18.5 with Sequel and with Active Record. With Mongoid, every step except db:migrate runs; the sample says to skip that one.

Changes to the sample:

  • $ bundle after padrino g admin. g admin adds activesupport and bcrypt to the Gemfile, so on a fresh machine the next command stopped with Bundler::GemNotFound.
  • $ padrino g model post body:text and a second $ padrino rake db:migrate, after the seed step. padrino g admin_page post needs a Post model, and a fresh project has none. The model comes after the first migrate because generating it boots the project, which on Sequel loads the Account model; before its table exists, that prints a load error. This is the order the padrino-admin guide uses.
  • # Mongoid: skip db:migrate before the first padrino rake db:migrate. Mongoid projects have no db:migrate task (only the Active Record and Sequel tasks define it), so for them that step fails with "Don't know how to build task 'db:migrate'". The other steps, db:seed included, apply to every ORM. After padrino g admin, the generator's own next steps include rake db:migrate for Active Record and Sequel, and only rake db:seed for Mongoid.

At 320px, the terminal text was 4px wider than its box, on master too. Below 360px, the home page's code windows get 16px side padding instead of 20px, on the code and on its file label alike, so the 32-character lines fit. Other widths are unchanged.

Checked:

  • Every $ line run exactly as written, in fresh projects generated with the home page generator's defaults (Sequel, sqlite, slim, rspec) and with Active Record and sqlite, on Padrino 0.18.5. Each command succeeds with no error output; padrino start serves /admin; logging in and creating a post through /admin/posts work.
  • With Mongoid, the same commands with db:migrate skipped, up to padrino start serving /admin. db:seed and logging in weren't run, because no MongoDB server was available.
  • The site built from master and from this branch: index.html differs only by the sample's lines, and the stylesheet only by the new rule.
  • The home page at 1440, 1024, 768, 390 and 320 wide, light and dark. The terminal's text fits its box at every width (at 320: 286/286, master 290/286). Box size and position match master, and there's no page-level horizontal scroll.
  • No new console or network errors.
  • It merges cleanly with Home page: admin ORMs and the Thin server option match Padrino 0.18 #64.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JWpdhd1LepyfkNRGx9kwrD

The home page's admin terminal sample runs `padrino rake db:migrate`,
which only ActiveRecord and Sequel projects define; `padrino g admin`
lists that step only for those two ORMs, and a Mongoid project has no
db:migrate task. A comment line before the step says so, in the same
style as the sample's existing comment line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWpdhd1LepyfkNRGx9kwrD
…g the rest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWpdhd1LepyfkNRGx9kwrD
@nesquena nesquena changed the title Home page: mark the admin sample's migrate step as ActiveRecord and Sequel Home page: note that Mongoid projects skip the admin sample's migrate step Nov 11, 2026
@nesquena
nesquena requested a review from achiurizo November 11, 2026 13:31
The admin sample ran `padrino g admin_page post` on a project with no
Post model, so the command failed. Generate the model first, before the
migrate step, so its table is created with the accounts table.

At viewports under 360px the sample's longest lines were 4px wider than
the code window. Trim the code window's side padding there to 1rem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWpdhd1LepyfkNRGx9kwrD
`padrino g admin` adds bcrypt and activesupport to the Gemfile and asks
you to run `bundle`. Without it, the sample's next commands stop with
Bundler::GemNotFound. Add the `bundle` step after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWpdhd1LepyfkNRGx9kwrD
@nesquena nesquena changed the title Home page: note that Mongoid projects skip the admin sample's migrate step Home page: make the admin sample run as shown, and fit it at 320px Nov 11, 2026
…again

On Sequel, generating a model boots the project, which loads the Account model
g admin wrote; before the first migrate its table doesn't exist and the
generator prints a load error. This is the order the padrino-admin guide uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWpdhd1LepyfkNRGx9kwrD
@nesquena
nesquena merged commit 2aea971 into master Nov 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants