Displaying 3 results from an estimated 3 matches for "current_order".
2012 Jun 21
0
How to access an engine's method from main application?
Hi,
I''m not sure if this is the right place to post this, but please redirect
me if I''m posting this in the wrong place.
I''m trying to use a method defined in an engine''s library, specifically it
is the current_order method from the Spree::Core
engine:
https://github.com/spree/spree/blob/master/core/lib/spree/core/current_order.rb
In my view, I''ve tried
Spree::Core::CurrentOrder.
current_order
Using just "current_order" in development works fine though, but not
in production.
So t...
2010 Apr 14
1
Rails validations app specific problems
...format.html { redirect_to( current_cart_url ) }
format.xml { head :ok }
else
format.html { redirect_to( current_cart_url ) }
format.xml { render :xml => @order.errors, :status =>
:unprocessable_entity }
end
end
end
def cart
create_current_order unless current_order
@order = current_order
end
def checkout
@order = current_order
end
def complete_order
@order = current_order
respond_to do |format|
if @order.update_attributes(params[:order])
@order.complete #sets order completed at date and state to
...
2010 Apr 14
1
Rails does not display form error message on a custom method
...or messages should appear if the customer order
number is not unique for that client.
Below is the custom method (checkout) related code.
Order Model:
[code]
validates_uniqueness_of :customer_order_number, :scope => :client_id
[/code]
Orders_controller:
[code]
def checkout
@order = current_order
end
def complete_order
@order = current_order
respond_to do |format|
if @order.update_attributes(params[:order])
@order.complete #sets submitted datetime and state to ''complete''
flash[:notice] = ''Thank you! Your order is being processed...