bullet-train-pro / bullet_train-action_models

Other
4 stars 1 forks source link

`new_button_one` partial doesn't work #42

Open bborn opened 1 year ago

bborn commented 1 year ago

I followed the example in the docs here: https://bullettrain.co/docs/action-models

I did:

bin/super-scaffold action-model:targets-many Duplicate Agent Team

And out of the box, it doesn't work. First, I had to add this line to my duplicate_actions.en.yml:

performed_count_over_target_count: heading: Progress

Not sure why that wasn't added by the scaffolding.

Then, after adding this to my model show partial agent.show.erb.html:

<%= render "account/agents/duplicate_actions/new_button_one", agent: agent, team: team %>

It does render an action button: https://d.pr/i/DsxnMs

But clicking the button doesn't work:

https://d.pr/i/fYurRL

btoone commented 1 year ago

@bborn We worked around by using link_to instead of the button. Also added data for turbo_frame. Like this

<%= link_to t('affiliates/ban_actions.buttons.shorthand.create'),
    [:new, :account, workspace, :affiliates_ban_action, affiliates_ban_action: {target_ids: [affiliate.id]}],
    class: 'button-secondary button-smaller',
    data: {turbo_frame: :dialog} %>

Didn't spend the time confirming my exp might be a bug, assumed it was my lack of understanding of the BT framework since its new to me. Thanks for posting, I'll be watching this to see where it goes but hopefully that helps in the meantime. Lmk if it does.

gazayas commented 1 year ago

Linking #15