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 594fdbc5b4f799990c3f3237921aae9589490e8c)
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 594fdbc5b4f799990c3f3237921aae9589490e8c)