# How to change column names

**URL:** <https://www.ruby-forum.com/t/how-to-change-column-names/142082>\
**Category:** Rails\
**Created:** [July 3, 2008, 10:24am UTC](https://www.ruby-forum.com/t/how-to-change-column-names/142082 "2008-07-03T10:24:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemisphere](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/eb9ed0/32.png) [@hemisphere](https://www.ruby-forum.com/u/hemisphere)\
**Post date:** [July 3, 2008, 10:24am UTC](https://www.ruby-forum.com/t/how-to-change-column-names/142082/1 "2008-07-03T10:24:19Z")

</div>

I want to change my column’s names of my table only in view mode. I  
don’t want to change database. For example in my table there is a column  
“code\_id” but in rhtml file when i write column.name it shoul gives me  
“Id Code”.

how can i specify “code\_id” to “Id Code” in model?

---

<div class="post-metadata">

**Author:** ![hemisphere](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/eb9ed0/32.png) [@hemisphere](https://www.ruby-forum.com/u/hemisphere)\
**Post date:** [July 3, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/how-to-change-column-names/142082/2 "2008-07-03T15:36:27Z")

</div>

in your view

Id Code: \<%= @modelname.code\_id %\>

scaffolds have a limit my friend…

On Jul 3, 9:24 am, Emre E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
