Hi all,
Is it possible to pass a model name as a variable?
For example in controller there is a method like this,

def list
var = User.find(:all)
end

where in var we heve collected all data from users table. If i edit the
above code like the one below, will it do the same work?


def list(modl)
var = tab.find(:all)
end

def hi
tab = User
list(tab)
end

someone please help.

thanks,
shanmu
-- 
Posted via http://www.ruby-forum.com/.

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