如何创建link_to成为rails中的方法帖子?我尝试通过链接将params发送到控制器。我有这样的路线:
match '/create_session_upload_pdf_id' => "dashboard#create_session_upload_pdf_id", :as => "create_session_upload_pdf_id", :via => [ :post ]
我在这个视图中有link_to:
<%= link_to image_tag('image.png', :alt => 'click me', :id => 'test'), create_session_upload_pdf_id_path(bill: @bill), method: :post %>
为什么如果我点击link_to,不发送帖子但是变成了? 请告诉我,如果我错了?