Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Generated scaffold for model with same plural as singular gives errors

#3095

If you generate a scaffold from a model for which the plural and singular forms are the same (like species), then there are some errors:

in new.html.erb:
<% form_for(@MODELNAME) do |f| %>
needs to be changed to <% form_for(@MODELNAME, :url=> {:action=>'create'}) do |f| %>

<%= link_to 'Back', MODELNAME_path %>
needs to be changed to
<%= link_to 'Back', MODELNAME_index_path %>

I haven't dived into the code to work out how to add a test for this and patch, but could do if that is likely to be useful

Reported by Tim Diggins · August 25th, 2009 @ 02:27 PM

State: wontfix
Milestone: none
Assigned to: José Valim José Valim
Importance: none

Activity

  1. José Valim
    José Valim
    • Assigned user set to José Valim

    August 30th, 2009 @ 09:39 AM

  2. José Valim
    José Valim
    • State changed from new to wontfix

    Tim, it seems to be a very rare case where scaffold does not work by default. By this reason, I'm marking it as won't fix. The amount of code necessary to make it work by default does not seem to fit the use.

    August 30th, 2009 @ 04:14 PM

  3. Tim Diggins
    Tim Diggins

    I agree, and that's a very sensible response! Maybe having this "won't fix" issue will do some good, by helping the rare few who have this problem and search for it.

    September 7th, 2009 @ 12:35 PM