Skip to content

Instantly share code, notes, and snippets.

@ohayon
Created December 10, 2012 02:05
Show Gist options
  • Save ohayon/4247981 to your computer and use it in GitHub Desktop.
Save ohayon/4247981 to your computer and use it in GitHub Desktop.
index
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
@mattcarbone
Copy link

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment