small medium large xlarge

Generic-user-small
20 Jun 2008, 12:57
Dominic Amann (2 posts)

I have tried the DRY forms example, but I am stumped at an error. Voucher is a simple table with the text field “test” in it.

undefined method `vouchers_path’ for #

Extracted source (around line #2):

1: 2: <% error_handling_form_for(@voucher) do |f| -%> 3: <%= f.text_field :test %> 4: <% end %>

Any clues?

btw, percent signs are disappearing in my post - they are there until I hit ‘save changes’.

Mike-120_pragsmall
07 Jul 2008, 23:31
Mike Clark (51 posts)

Hi Dominic,

The vouchers_path method comes from the RESTful routing conventions. You’ll need to make sure you have the following line in your config/routes.rb file:

map.resources :vouchers

Hope that helps.

Mike

You must be logged in to comment