Hi Chris,

On Tue, 2009-03-10 at 00:04 +0100, Chris Gunnels wrote:
> I am using a mysql db and I want to pull some info from the db. I think
> my problem is 

You'll find it easier to get help here if you'll post the error message
that demonstrates your problem, along with the code that the error
message tells you is causing the problem.

> that I am trying to get the data from an object that
> doesn't exist in my MemberController. My code:
> [code]
> class MemberController < ApplicationController
>   def index
>     @login = User.find_by_login(params[:l])
>     flash[:notice] = @login + ", you've logged in successfully"
>   end
> end
> [/code]

However, in this case you may well have told us the probable cause of
the problem.

> the table in the db is the User table and it has a column of login.

Rails' default is that the table name is a plural version of the model
name.  That's because the Model typically represents a single record
from a table.  So the table named Users holds lots of records that are
access via the User model.

HTH,
Bill


--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to