i have a codes model and i a basically have a form wich should authenticate simply to every code recorded so my controller is:
def cancel_sale
@codes = Code.find(:all)
@codes.each do |c|
@code = c.name
end
if params[:auth] && params[:auth] == @code
something
else
@mensaje_de_salida = "wrong auth code"
end
end
i know it's bad, at this moment it only authenticates to the last recorded code.
thanks in advance.