“No route matches [POST]” when changing link_to to button_to

前端 未结 4 676
余生分开走
余生分开走 2021-02-04 04:45

I have this piece of code:

<%= link_to \"New User\", new_user_path, :class => \"button\"  %>

which works fine, but when I

4条回答
  •  醉话见心
    2021-02-04 05:06

    Instead of forcing button_to to use a non-default method, you can also send a class to link_to.

    <%= link_to "New User", new_user_path, :class => "button" %>
    

提交回复
热议问题