我有一个link_to,我想转换成一个按钮。但不知道如何在button_to调用中传递参数plan_id。按照其他线程,我已经使用button_to调用中的get方法。link_to的作品,但不是button_to与参数传递
作品:
<%= link_to "Sign up", new_subscription_path(:plan_id => plan.id) %>
没有得到plan_id的数据类型传递:
<%= button_to "Sign up", new_subscription_path(:plan_id => plan.id) , :class => "btn btn-primary btn-large", :method => :get %>
请你能告诉我什么是错的?
它无法识别订阅控制器。我一整天都在尝试这么多的连击。 Ruby语法对我来说太深奥了。 – user2511030