This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
headers: { | |
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_image | |
@user.image.clear #This is optional you can skip it | |
@user.image.destroy #This line delete image from paperclip | |
# Now you need to update image url because destroy is not remove url so you need to update image field | |
@user.update_attributes(image: nil) | |
end | |
#Note: You can directaly update your image field but it doesn't delete image from storage. | |
#Note1: Controller name may be changed according to your requirement. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.currency = "INR" | |
#After that we need to update products currency accordingly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def before_delivery | |
if @order.needs_delivery? | |
return if params[:order].present? | |
packages = @order.shipments.map(&:to_package) | |
@differentiator = Spree::Stock::Differentiator.new(@order, packages) | |
else | |
#we select the shipping for the user | |
@order.select_default_shipping | |
@order.next #go to next step |
NewerOlder