Created
December 10, 2012 02:05
-
-
Save ohayon/4247981 to your computer and use it in GitHub Desktop.
index
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 index | |
if params(:state) == used | |
@coupons = Coupon.all(params[:state]) | |
else | |
@coupons = Coupon.all | |
end | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @coupons } | |
end | |
end |
Author
ohayon
commented
Dec 10, 2012
You don't actually need the has_key? check in this case
lgtm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment