How to convert the model_name to table_name in ruby on rails


#1

Hi,

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

Example: CustomerDetail to customer_details

Regards,


#2

Venkat E. 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… :slight_smile:

table = ModelName.table_name


#3

“CustomerDetails”.tableize is what you should do.

/Jakob