Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ash_phoenix.gen.html generator #112

Merged
merged 24 commits into from
Oct 16, 2023

Conversation

wintermeyer
Copy link
Contributor

@wintermeyer wintermeyer commented Oct 13, 2023

Adds a new ash_phoenix.gen.html generator which creates a controller and HTML views for an existing Ash resource.

NOTE: This code is a bit wild west. Not because of a lack of effort but because of a lack of knowledge and talent.

$ mix ash_phoenix.gen.html Shop Product products
* creating lib/xyz_web/controllers/product_controller.ex
* creating lib/xyz_web/controllers/product_html/edit.html.heex
* creating lib/xyz_web/controllers/product_html.ex
* creating lib/xyz_web/controllers/product_html/index.html.heex
* creating lib/xyz_web/controllers/product_html/new.html.heex
* creating lib/xyz_web/controllers/product_html/product_form.html.heex
* creating lib/xyz_web/controllers/product_html/show.html.heex

  Add the resource to your browser scope in lib/product_web/router.ex:

    resources "/products", ProductController

generator

@zachdaniel
Copy link
Contributor

Wow :)

Copy link
Contributor

@zachdaniel zachdaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great :) Only have one comment about consistency of generator arguments. At some point in the future we will have an answer for generators "in general" (we're building a tool for it), but there is no reason not to start here and integrate the tool we're working on, especially as this is already done and looks great 🥳

@zachdaniel zachdaniel merged commit 18fa992 into ash-project:main Oct 16, 2023
@wintermeyer wintermeyer deleted the ash_phoenix.gen.html branch October 23, 2023 07:49
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