Hello,
I use ActiveScaffold with one of my models, which supports finding records by slugs (via friendly_id). And I've noticed some strange behavior:
While .show works pretty well with this:
Started GET "/fremantle/resources/63429" for ::1 at 2015-09-10 23:42:40 +0300
Processing by Fremantle::Guest::ResourcesController#show as HTML
Parameters: {"id"=>"63429"}
Fremantle::Resource Load (0.3ms) SELECT "fremantle_resources".* FROM "fremantle_resources" WHERE "fremantle_resources"."slug" = ? ORDER BY "fremantle_resources"."permalink" DESC LIMIT 1 [["slug", "63429"]]
…but .index with id (single-element list) doesn't work (doesn't find the record):
Started GET "/fremantle/resources/63429/list" for ::1 at 2015-09-10 23:43:27 +0300
Processing by Fremantle::Guest::ResourcesController#index as HTML
Parameters: {"id"=>"63429"}
(0.3ms) SELECT COUNT(*) FROM "fremantle_resources" WHERE "fremantle_resources"."id" = ? [["id", 63429]]
As ActiveScaffold already has some solution (do_show) which works well, may some part of it be ported to do_list ?
P.S. In rails console the difference is in parameter to find method:
Fremantle::Resource.find("63429") works well, while Fremantle::Resource.find(63429) doesn't work.
Hello,
I use ActiveScaffold with one of my models, which supports finding records by slugs (via friendly_id). And I've noticed some strange behavior:
While
.showworks pretty well with this:…but
.indexwith id (single-element list) doesn't work (doesn't find the record):As ActiveScaffold already has some solution (
do_show) which works well, may some part of it be ported todo_list?P.S. In rails console the difference is in parameter to
findmethod:Fremantle::Resource.find("63429")works well, whileFremantle::Resource.find(63429)doesn't work.