pass parameter by link_to ruby on rails

后端 未结 4 777
孤城傲影
孤城傲影 2020-11-30 21:58

I have this line of code:

<%= link_to \"Add to cart\", :controller => \"car\", :action => \"add_to_cart\", :car => car %>

wh

4条回答
  •  北海茫月
    2020-11-30 22:27

    The above did not work for me but this did

    <%= link_to "text_to_show_in_url", action_controller_path(:gender => "male", :param2=> "something_else") %>

提交回复
热议问题