Link + Params


I have database called "Auth", there are following fields: id, auth, is_active, created_at, updated_at and i have 1 active record:

One way to slice it: In your controller's find action, instead of doing: @auth = Auth.find(params[:id])

You could use: @auth = Auth.find_by_auth(params[:auth])

I'm assuming you have a unique constraint on the auth field...

Thanks for fast response!.

#controller class AnswersController < ApplicationController

  layout "default"

  def create

  @w1 = rand(9999999)   @w = Digest::SHA1.hexdigest(@w1.to_s)

  @token = Token.find_by_token(params[:token])

  # params[:token] # if         #@answers =>121,:question_id=>   questions = Question.find(:all,:conditions=>"enabled=1")   questions.each do |question|             if params["answer_"]      @answers[]=params["answer_"]          if ! Answer.create(:question_id=>,:token=>"",:text=>params["answer_"])       flash[:error]="Can`t create answer!"      end             end   end   if !flash[:error]           redirect_to :action=>"pass"            return false   end

# end


  def index      @questions = Question.find(:all,:conditions=>"enabled=1") #.where(["id = 1"])


  def pass   flash[:notice]="<span id='ty'>Thank you for your answers!</span>"         render :text=>"", :layout=>"ty"   end

  def about   end


Well I'm entirely sure what you're trying to do but presumably you'll need to grab something out of the params hash (params[:auth] for the url given in your first email) and then verify that a token of that value does indeed exist in your database (and is still active)