Created
January 18, 2010 12:09
-
-
Save tomlea/279962 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
def sort_order | |
# Google was indexing "random" search orders, it parsed our javascript, badly. | |
SORT_METHODS[params[:sort_order]] or raise_redirect_to(@product, :status => 301) | |
end | |
def segment | |
segment = params[:segment] | |
segment = segment.to_sym if %w[all other].include?(segment) | |
segment = nil if segment == :all | |
# Bad or expired segments need 301ing | |
raise_redirect_to(@product, :status => 301) if segment === String and [email protected]?(segment) | |
segment | |
end | |
def show | |
@product.reviews.for_segment(segment).order_by(sort_order) | |
end | |
def show_extended_detail | |
@product.reviews.for_segment(segment).order_by(sort_order) | |
… | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment