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

ActionController::UrlGenerationError in Avo::XXXX#new #981

Closed
2 of 6 tasks
shiroemons opened this issue Jun 21, 2022 · 4 comments
Closed
2 of 6 tasks

ActionController::UrlGenerationError in Avo::XXXX#new #981

shiroemons opened this issue Jun 21, 2022 · 4 comments

Comments

@shiroemons
Copy link
Contributor

Describe the bug

If show_on: :forms is specified, ActionController::UrlGenerationError is raised when accessing new page.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Add the show_on: :forms option.
  2. Click on '[ + Create new xxx ]' button
  3. See error

Expected behavior

The new page is displayed.

Actual behavior

An error occurs.

System configuration

Avo version: 2.9.0

Rails version: 7.0.3

Ruby version: 3.1.2

License type (Community or Pro): Community

Screenshots

image

Additional context

It worked when I changed it to show_on: :edit.

Impact

  • High impact
  • Medium impact
  • Low impact

Urgency

  • High urgency
  • Medium urgency
  • low urgency
@adrianthedev
Copy link
Collaborator

Hey @shiroemons. This is my bad here. I'll update the docs now. The associations can be shown only on the :index, :show, and :edit screens. The :create view is not supported at the moment.

It needs some information from the parent like id, reflections, and others. So the flow here is to create an item (no associations visible), then go on the edit screen and add them.

You can control what happens after the creation process is finished so you could redirect the user directly to the edit screen.

@adrianthedev
Copy link
Collaborator

I'll close this for now, but feel free to re-open it ✌️

@shiroemons
Copy link
Contributor Author

Hi @adrianthedev

I understand the process and have no problem with close.

I think this docs needs to be updated as well.
https://docs.avohq.io/2.0/associations.html#has-and-belongs-to-many

@adrianthedev
Copy link
Collaborator

That one slipped through. Pushed an update now. Thank you for letting me know!

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

No branches or pull requests

2 participants