Ryan Bigg wrote:
> qvvalup is not the same as qvvaluf, unless you're speaking a language
> I'm not recognising. Rails works "best" with english words and
> pluralization. Somewhere in your app you're referencing
> qvvaluf_path... probably a scaffold somewhere. Got a stack trace for us?
> -----
> Ryan Bigg
> Freelancer
> http://frozenplague.net
I am working with a legacy database and so pluralization is out of the
question. But in the same way Rails uses pluralization, we have
"generalized" and use P as suffix for tables and F as suffix for
records. Hence the qvvalup and qvvaluf.
You are right for the scaffold. Used the scaffold generator to provide
for a skeleton for the recipes example, then just did a very basic
search/replace, replacing recipes with qvvalup and recipe with qvvaluf.
Below a stack trace and my index.html.erb where you can find all my
"replacements" of recipes and recipe. Perhaps I should have replaced
recipe with qvvalup insteas of qvvaluf ?
Stacktrace:
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/polymorphic_routes.rb:112:in
`__send__'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/polymorphic_routes.rb:112:in
`polymorphic_url'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/polymorphic_routes.rb:119:in
`polymorphic_path'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/url_helper.rb:91:in
`url_for'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/url_helper.rb:228:in
`link_to'
app/views/qvvalup/index.html.erb:17
app/views/qvvalup/index.html.erb:11:in `each'
app/views/qvvalup/index.html.erb:11
app/controllers/qvvalup_controller.rb:7:in `index'
Index.html.erb:
<h1>Werken met valuta</h1>
<table>
<tr>
<th>Valuta</th>
<th>Omschrijving</th>
<th>Koers</th>
<th>Aantal decimalen</th>
</tr>
<% for qvvaluf in @qvvalup %>
<tr>
<td><%=h qvvaluf.qvqvcode %></td>
<td><%=h qvvaluf.qvqvomsc %></td>
<td><%=h qvvaluf.qvqvkoer %></td>
<td><%=h qvvaluf.qvqvaant %></td>
<td><%= link_to 'Show', qvvaluf %></td>
<td><%= link_to 'Edit', edit_qvvaluf_path(qvvaluf) %></td>
<td><%= link_to 'Destroy', qvvaluf, :confirm => 'Are you sure?',
:method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New qvvaluf', new_qvvaluf_path %>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---