Repository navigation
Home page: make the admin sample run as shown, and fit it at 320px - #65
Merged
Merged
Conversation
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
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
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:migrateruns; the sample says to skip that one.Changes to the sample:
$ bundleafterpadrino g admin.g adminaddsactivesupportandbcryptto the Gemfile, so on a fresh machine the next command stopped withBundler::GemNotFound.$ padrino g model post body:textand a second$ padrino rake db:migrate, after the seed step.padrino g admin_page postneeds 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:migratebefore the firstpadrino rake db:migrate. Mongoid projects have nodb:migratetask (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:seedincluded, apply to every ORM. Afterpadrino g admin, the generator's own next steps includerake db:migratefor Active Record and Sequel, and onlyrake db:seedfor 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:
$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 startserves/admin; logging in and creating a post through/admin/postswork.db:migrateskipped, up topadrino startserving/admin.db:seedand logging in weren't run, because no MongoDB server was available.index.htmldiffers only by the sample's lines, and the stylesheet only by the new rule.🤖 Generated with Claude Code
https://claude.ai/code/session_01JWpdhd1LepyfkNRGx9kwrD