Created
August 4, 2009 08:53
-
-
Save charly/161117 to your computer and use it in GitHub Desktop.
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
module OrdersHelper | |
# helper to determine the active order step given : | |
# 1. a params[:step] | |
# 2. if none, according to the order's state | |
def active_step | |
@active_step ||= if params[:step] | |
params[:step] | |
elsif %(opened).include? @order.state | |
"1start" | |
elsif %(submitted).include? @order.state | |
"2price" | |
elsif %(evaluated).include? @order.state | |
"3bill" | |
elsif @order.state=="billed" | |
"4payment" | |
else | |
"5end" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment