mercredi 4 avril 2018

Page reload in ruby controller function

In my ruby application, i have a controller function to decrease the count of the product quantity in the cart.

order_controller_decorator.rb:

def decrease
  quantity = change_quantity(-1)
  render json: { quantity: quantity, total:current_order.display_item_total }
end 

Here,how can i make my page to reload after the decrease action.

I have tried adding

redirect_to :back

But it didn't work.

Please help me to solve this issue..

Aucun commentaire:

Enregistrer un commentaire