How to convert the model_name to table_name in ruby on rails

Hi,

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

Example: CustomerDetail to customer_details

Regards,

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

“CustomerDetails”.tableize is what you should do.

/Jakob