Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 rails 应用程序的 path.rb 文件中有以下路线。'/table_name/:id/edit' 指向 edit.html 文件。我需要从传入的字符串“name”中提取:id,这是表的行之一。我该怎么做。
您可以使用参数来提取 id
params[:id]