标签: ruby-on-rails ruby
我是Rails的新手,我有一个数据库,根据用户的搜索链接到某个页面,但它总是会给我ID。
例如,如果用户搜索,我将获得“localhost:3000 / fruit / 1”而不是“localhost:3000 / fruit / apple”。有谁知道如何将URL从id切换到名称?