Skip to content

mix ash_phoenix.gen.html generates create form with "Save Product" button regardless of resource name #392

@j-n-f

Description

@j-n-f

Code of Conduct

  • I agree to follow this project's Code of Conduct

AI Policy

  • I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.

Versions

Don't dig too far into this, I think I've pinpointed the issue.

$ elixir -v
Erlang/OTP 27 [erts-15.2.7] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Elixir 1.18.3 (compiled with Erlang/OTP 27)
$ mix deps | grep phoenix
* ash_authentication_phoenix 2.10.3 (Hex package) (mix)
  locked at 2.10.3 (ash_authentication_phoenix) 89be0de6
* ash_phoenix 2.3.11 (Hex package) (mix)
  locked at 2.3.11 (ash_phoenix) 33294de6
* phoenix 1.7.21 (Hex package) (mix)
  locked at 1.7.21 (phoenix) 336dce4f
* phoenix_ecto 4.6.5 (Hex package) (mix)
  locked at 4.6.5 (phoenix_ecto) 26ec3208
* phoenix_html 4.2.1 (Hex package) (mix)
  locked at 4.2.1 (phoenix_html) cff10810
* phoenix_html_helpers 1.0.1 (Hex package) (mix)
  locked at 1.0.1 (phoenix_html_helpers) cffd2385
* phoenix_live_dashboard 0.8.7 (Hex package) (mix)
  locked at 0.8.7 (phoenix_live_dashboard) 3a8625ca
* phoenix_live_reload 1.6.0 (Hex package) (mix)
  locked at 1.6.0 (phoenix_live_reload) b3a1fa03
* phoenix_live_view 1.0.17 (Hex package) (mix)
  locked at 1.0.17 (phoenix_live_view) a4ca05c1
* phoenix_pubsub 2.1.3 (Hex package) (mix)
  locked at 2.1.3 (phoenix_pubsub) bba06bc1
* phoenix_template 1.0.4 (Hex package) (mix)
  locked at 1.0.4 (phoenix_template) 2c0c81f0
* phoenix_view 2.0.4 (Hex package) (mix)
  locked at 2.0.4 (phoenix_view) 4e992022

Operating system

Arch Linux on WSL2

Current Behavior

Create form has a save button that says "Save Product"

Reproduction

$ mix ash_phoenix.gen.html <domain> <resource> --resource-plural <pluralized-name>

Observe that creation form has button that says "Save Product"

Pretty sure upgrading won't resolve the issue, see here:

Judging by what I see on the index template:

<.button>New <%= @resource %></.button>

I'm new to this framework, but I think we just need to change the resource_form.html.heex.eex to look more like:

<.button>Save <%= @resource %></.button>

I searched through the repository and didn't find any other instances of this.

Expected Behavior

Button says "Save "

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions