Enable scaffold generator to create phlex classes not erb files (phlex v2) #237
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.
This change enables the standard rails scaffold generator to create
Phlex
views instead of.erb
templates.It also wires up the generated controllers to these views. The actual look of the views is almost identical to the erb ones which means the generated standard tests all work fine.
The purpose is to showcase how Phlex can be used to create a (basic but well understood) object-oriented UI in Rails.
See the commit messages for how to try this out manually.
I've been through the rails generator code and tried all the cases I can find including attachments, password digests and references.
Unfortnately I couldn't find an easy way to test this automatically without interfering with the existing
test/dummy/app
installation. There are issues with rails locking the application layout file, and with wanting to run the generated tests from within the test that generates them!I'd be happy to add tests in if someone can suggest a good way to do it. Perhaps creating a dummy2 app? Or perhaps putting all this generation code in a new repo?
NB: I've also fixed the existing tests to use the
phlex v2
naming conventions (see 594fdbc)