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.
我必须触发特定网站的操作。但是,它应该处理具有某些键/值对 ( params = {:cost => 5, :state => "NY"}) 的参数。有没有办法在 URL 中指定这些参数值?否则我将如何提供这些键/值?
params = {:cost => 5, :state => "NY"}
show_things_path(:cost => 5, :state => "NY")
将这些键/值添加到参数中。
编辑:
对于字符串 URL
"/show_things?cost=5&state='NY'"