0

Is there a way to have the equivalent of

<%= link_to "Continue", "/profile" %>

but with a button_to? From what I understand you have to use a rails route. like new_user_path or something.

I was thinking something like this

<%= button_to "Continue", "/profile", method: :get %>

let me know if it's possible, and if not then some maybe my best alternative... Thanks

4

1 回答 1

0

据我了解,您可以只使用一个字符串。所以<%= button_to "Continue", "/profile", { :method => :get } %>提供

<form action="/profile" class="button_to" method="get">
  <div>
    <input type="submit" value="Continue" />
  </div>
</form>

是你想要的吗?

于 2012-08-02T05:57:38.007 回答