Class: Spree::Admin::LoyaltyPointsTransactionsController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Admin::LoyaltyPointsTransactionsController
- Defined in:
- app/controllers/spree/admin/loyalty_points_transactions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/spree/admin/loyalty_points_transactions_controller.rb', line 14 def create invoke_callbacks(:create, :before) @object.attributes = loyalty_points_transaction_params if @object.save invoke_callbacks(:create, :after) respond_with(@object) do |format| format.html { redirect_to location_after_save, success: (@object, :successfully_created) } format.js { render layout: false } end else invoke_callbacks(:create, :fails) respond_with(@object) do |format| format.html { render action: :new } end end end |
#order_transactions ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/spree/admin/loyalty_points_transactions_controller.rb', line 8 def order_transactions order = Spree::Order.find_by(id: params[:order_id]) @loyalty_points_transactions = @user.loyalty_points_transactions.for_order(order).includes(:source).order(updated_at: :desc) respond_with @loyalty_points_transactions end |