Steve Scruggs wrote: > I am using Rails 2.3.4 and when I use rspec_scaffold the code that is > generated does not work without modification. For example, the link_to > that is generated for a show > <td><%= link_to 'Show', invoice_payment %></td> > > fails with "invoice_payment_url failed to generate from > {:format=>#<InvoicePayment id: 1, ...."
Judging from this error. It appears to me that you have a problem with your routing. It appears to be trying to take the invoice_payment object as the :format for the URL, which would not be correct. Make sure that you don't have a route in your routes.rb file that is interfering with the resource routing. > but if I change the code to > <td><%= link_to 'Show', :id => invoice_payment %></td> > it works fine. This seems inconsistent with the documentation. This work, but is bizarre syntax. You're forcing the invoice_payment.id into the :id parameter making it work, but the "proper" syntax when not using the shortcut syntax would be: <td><%= link_to 'Show', invoice_payment_path(invoice_payment) %></td> -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---