On 29 March 2011 08:22, HelloRails <[email protected]> wrote:
> Hello!
>
> I have database called "Auth", there are following fields: id, auth,
> is_active, created_at, updated_at and i have 1 active record:
> ------------------------------------------------------------------------------------
> 1, lala999, 1, 20-03-20111 15:14:12, 20-03-20111 15:14:12
> ------------------------------------------------------------------------------------
>
> I need following url => `'localhost:3000/?auth=lala9999'` (this I have
> in my database and this field should come from DB).
>
> How can i do it?

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...

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to