# Legacy database: help needed

**URL:** <https://www.ruby-forum.com/t/legacy-database-help-needed/156042>\
**Category:** Rails\
**Created:** [December 19, 2008, 6:08pm UTC](https://www.ruby-forum.com/t/legacy-database-help-needed/156042 "2008-12-19T18:08:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [December 19, 2008, 6:08pm UTC](https://www.ruby-forum.com/t/legacy-database-help-needed/156042/1 "2008-12-19T18:08:24Z")

</div>

I am “new” to Ruby and Rails and jumping right in. That’s for me the  
best way to learn quickly. I am trying to do a simple project on a  
legacy database. I performed the following steps:

Created a new project, then with the generator scaffold created a  
simple “recipes” table.

I am coming from IBM iSeries where we have tables and so called record  
formats. For example the table is named “qvvalup” and the record  
format is named “qvvaluf”, where the record format “handles a single  
record” so to speak. So we have the same kind of concept as with the  
rails pluralization: recipes and recipe.

I made copies of folders and files and renamed accordingly. A few  
examples. The model file “recipe.rb” I copied to “qvvaluf.rb”. And the  
folder “apps/views/recipes” I copied to “apps/views/qvvalup”. I have a  
“qvvalup\_controller.rb” and so on. Also did a search and replace in  
all the files self. So “recipes” to “qvvalup” and then “recipe” to  
“qvvaluf”. Did put in a “map” in “routes.rb” as well:

map.resources :qvvalup

Next step was editing my model file “qvvaluf”:

set\_table\_name “qvvalup”  
set\_primary\_key “qvqvcode”

to be able to handle the pluralization and primary key.

I am getting an error when going to localhost:3000/qvvalup. The error  
seems to be in my “index.html.erb” when it is trying to create my  
“show link”:

undefined method `qvvaluf\_path’ for #ActionView::Base:0x4953c34

My “index.html.erb” is below and I can’t find anything that I might  
have forgotten to rename or whatever. Is it maybe the routing that is  
going wrong here ? Or something else ? Any help appreciated…

Thanks,  
Mark

“index.html.erb”:

# Werken met valuta

\<% for qvvaluf in @qvvalup %\>

\<% end %\>

| Valuta | Omschrijving | Koers | Aantal decimalen |
| --- | --- | --- | --- |
| \<%=h qvvaluf.qvqvcode %\> | \<%=h qvvaluf.qvqvomsc %\> | \<%=h qvvaluf.qvqvkoer %\> | \<%=h qvvaluf.qvqvaant %\> | \<%= link\_to 'Show', qvvaluf %\> | \<%= link\_to 'Edit', edit\_qvvaluf\_path(qvvaluf) %\> | \<%= link\_to 'Destroy', qvvaluf, :confirm =\> 'Are you sure?', :method =\> :delete %\> |

  

\<%= link\_to ‘New qvvaluf’, new\_qvvaluf\_path %\>
