尝试设置current_page规则,以多步形式显示Rails应用的特定页面中的一行
我的网址如下所示:
http://localhost:3000/orders/order_id/steps/initial_data http://localhost:3000/orders/order_id/steps/final_order http://localhost:3000/orders/order_id/steps/checkout
我只是尝试在以/ initial_data结尾的URL中传递特定行,而不是其余步骤
我的路线是:
order_step GET /orders/:order_id/steps/:id(.:format) order/steps#show
PATCH /orders/:order_id/steps/:id(.:format) order/steps#update
PUT /orders/:order_id/steps/:id(.:format) order/steps#update
orders GET /orders(.:format) orders#index
POST /orders(.:format) orders#create
root GET / orders#create
试过:
<% unless current_page?('/orders/:order_id/steps/inital_data') %>
something
<% else %>
something else
<% end %>
但它总是呈现出一些&#39;在表单的所有步骤中,无论它们是否以/ initial_data结尾。