Sha256: b186c87e0a30ca68f8c3ec207b25cf58f0b9a25a710acc14eafcdeb8cbef2526
Contents?: true
Size: 1.73 KB
Versions: 2
Compression:
Stored size: 1.73 KB
Contents
module Spree module Admin class AccountsController < ResourceController def index end def show @bling_account = SolidusBling::Account.find(params[:id]) end def new @bling_account = SolidusBling::Account.new @payment_methods = Spree::PaymentMethod.all.pluck(:name, :id) @shipping_methods = Spree::ShippingMethod.all.pluck(:name, :id) @bling_account.payment_methods.build @bling_account.shipping_methods.build @bling_account.sellers.build end def create bling_account = SolidusBling::Account.create account_params.merge(name: "Bling") redirect_to admin_accounts_path end def edit @bling_account = SolidusBling::Account.find(params[:id]) @payment_methods = Spree::PaymentMethod.all.pluck(:name, :id) @shipping_methods = Spree::ShippingMethod.all.pluck(:name, :id) end def update bling_account = SolidusBling::Account.find(params[:id]) bling_account.update account_params redirect_to edit_admin_account_path(bling_account.id) end def delete bling_account = SolidusBling::Account.find(params[:id]) bling_account.delete redirect_to admin_accounts_path end private def model_class SolidusBling::Account end def account_params params.require(:account).permit(:app_name, :client_id, :client_secret, :refresh_token, :api_base_url, :external_store_id, :incoming_category_id, payment_methods_attributes: [:id, :spree_payment_method_id, :external_id], shipping_methods_attributes: [:id, :spree_shipping_method_id, :alias], sellers_attributes: [:id, :name, :external_id]) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solidus_bling-2.0.1 | app/controllers/spree/admin/accounts_controller.rb |
solidus_bling-2.0.0 | app/controllers/spree/admin/accounts_controller.rb |