This project is archived and is in readonly mode.

#267 ✓stale
soliiid

form_for for singular resource will products plural invokes

Reported by soliiid | July 17th, 2008 @ 02:01 AM

for example:

in routes.rb

   map.resource :profile, :controller => 'profile'

in view:

   <% form_for(@profile) do |f| %>
      ...
      <%= f.submit "Save" %>
   <% end %>

if @profile.new_record? is true, it will raises a NoMethodError exception with the message:

undefined method `profiles_path' for #

if @profile.new_record? is false, the message is

You have a nil object when you didn't expect it!   The error occurred while evaluating nil.to_sym 


confirmed on

ruby: ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]

rails: freezed revision 9084

and

ruby: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]

rails: rails 2.0.2

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages