Forum: Ruby on Rails How to convert the model_name to table_name in ruby on rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D81c1821bb5fd0bb179a331175751908?d=identicon&s=25 Venkat Eee (venkat_ruby)
on 2009-05-07 07:37
Hi,

Can anyone help me "to convert the model_name to table_name in ruby on
rails"

Example: CustomerDetail to customer_details

Regards,
Be5bb7cef8ef41712500df51486f95e8?d=identicon&s=25 Jakob (Guest)
on 2009-05-07 08:18
(Received via mailing list)
"CustomerDetails".tableize is what you should do.

/Jakob
D81c1821bb5fd0bb179a331175751908?d=identicon&s=25 Venkat Eee (venkat_ruby)
on 2009-05-07 08:34
Venkat Eee wrote:
> Hi,
>
> Can anyone help me "to convert the model_name to table_name in ruby on
> rails"
>
> Example: CustomerDetail to customer_details
>
> Regards,









Hey.....

I got the solution for that... :-)

table = ModelName.table_name
This topic is locked and can not be replied to.