Ruby on rails Rails:什么是';类型';是否在xx#u路径中(类型:';标记';)执行?

Ruby on rails Rails:什么是';类型';是否在xx#u路径中(类型:';标记';)执行?,ruby-on-rails,Ruby On Rails,像这样的一段代码 <%= link_to 'find', xx_path(type: 'mark') %> 有人能告诉我怎么用打字机吗 <%= link_to 'find', xx_path(type: 'mark') %> 将任何内容传递给键值对中的route helper都将以params形式传递 您可以在控制器中使用params[:type]或params[“type”] 将任何内容传递给键值对中的route helper都将以params形式传递 您

像这样的一段代码

<%= link_to 'find', xx_path(type: 'mark') %>

有人能告诉我怎么用打字机吗


<%= link_to 'find', xx_path(type: 'mark') %>
将任何内容传递给键值对中的route helper都将以params形式传递

您可以在控制器中使用
params[:type]
params[“type”]


将任何内容传递给键值对中的route helper都将以params形式传递

您可以在控制器中使用
params[:type]
params[“type”]