I am using this method for search engine friendly URLs in Rails - http://jroller.com/obie/entry/seo_optimization_of_urls_in
My model looks like this.
class Listing < ActiveRecord::Base
def to_param
"#{id}-#{title.parameterize}"
end
end
This works with MySQL but not Postgresql.
This is the error I get:
ActiveRecord::StatementInvalid (PGError: ERROR: invalid input syntax for integer: "16- college-station-apartments" : SELECT * FROM "floorplans" WHERE ("floorplans"."listing_id" = E'16-college-station-apartments') ORDER BY beds ASC, baths ASC, footage ASC, price ASC):
Is ActiveRecord not doing a .to_i on the find for Postgresql?