Prefill record in new action #3857
Closed
manuelmeurer
started this conversation in
Feature requests
Replies: 1 comment 2 replies
-
Hey @manuelmeurer 👋 Inside the action class, within the Here's a minimal example: class Avo::Actions::Sub::DummyAction < Avo::BaseAction
# ...
def fields
field :persistent_text, as: :text, default: params[:persistent_text]
end
# ...
end So if you hit this URL:
You'll see the Let me know if that works for you! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to be able to pass parameters to the URL for the new action to prefill some fields, i.e.:
https://mysite.com/resources/myresources/new?myresource[title]=Hello
In the Avo code, there's a
fill_record
method that does this on create and update, but AFAICS there is no way currently to do this in the new action, correct?Beta Was this translation helpful? Give feedback.
All reactions