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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs