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.

Route generator does not work with to_param returning a Fixnum

#1415


class Shop
  def to_param
    1
  end
end

map.resources :shops

form_for Shop.new => TypeError: can't convert Fixnum into String

Reported by Piotr Usewicz · November 19th, 2008 @ 01:44 PM

State: wontfix
Milestone: 2.x
Assigned to: Michael Koziarski Michael Koziarski
Importance: none

Activity

  1. DHH
    DHH
    • Assigned user changed from DHH to josh

    November 19th, 2008 @ 01:48 PM

  2. Michael Koziarski
    Michael Koziarski

    I'm not sure this patch covers every other case which could possibly go wrong when a fixnum is passed instead of a string.

    My preference is to require people return strings.

    November 19th, 2008 @ 04:16 PM

  3. josh
    josh
    • Assigned user changed from josh to Michael Koziarski

    November 19th, 2008 @ 11:13 PM

  4. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to wontfix

    Error message is clear, to_param documentation is clear ("Returns a String"), agreed we should continue to require strings to hit the routing code.

    March 7th, 2009 @ 02:50 PM