Skip to content

Commit

Permalink
Add user store credit: Load modal with turbo frame
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Dec 20, 2024
1 parent aad8c9e commit 644f096
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@

<%= page_header_actions do %>
<%= render component("ui/button").new(
"data-action": "click->#{stimulus_id}#actionButtonClicked",
"data-#{stimulus_id}-url-param": solidus_admin.new_user_store_credit_path(user_id: @user.id, _turbo_frame: :new_store_credit_modal),
tag: :a,
href: solidus_admin.new_user_store_credit_path(user_id: @user.id),
data: {
turbo_frame: :new_store_credit_modal,
turbo_prefetch: false
},
text: t(".add_store_credit"),
icon: "add-line"
)%>
<% end %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@
<% end %>
<% end %>
<% end %>
<%= render component("users/store_credits/index").new(user: @user, store_credits: @store_credits) %>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ def initialize(user:, store_credit:, categories:)
@user = user
@store_credit = store_credit
@store_credit_categories = categories
@store_credits = Spree::StoreCredit.where(user_id: @user.id).order(id: :desc)
end

def form_id
Expand Down

0 comments on commit 644f096

Please sign in to comment.