Home > Software design >  In Rails (7.0.4) , Is there any way to change a attribute name from all over our application?
In Rails (7.0.4) , Is there any way to change a attribute name from all over our application?

Time:01-25

I wanna change "Author" to "Author_name" in my rails application.

So I have used "rename_column" method in the migration, then after running migration my column name is changed but after that I have to manually change it everywhere from my code ( Controller and view )

CodePudding user response:

It's not a question to Rails, but to your code editor. You just need to perform search and replace.

CodePudding user response:

So I have got my solution, This is a editor problem not a Rails one. I'm using Vs-code, we can do Ctrl Shift H. It will open a search and replace window.

enter image description here

You can change whatever you wanna change,

enter image description here

Thank you.

  • Related