How to call a controller method from a button in rails 4

前端 未结 5 560
日久生厌
日久生厌 2020-12-15 17:30

So I feel really stupid right now, but I can\'t seem to find an answer.

So I have a method which needs to be called EXACTLY once, and since this is only the experime

5条回答
  •  悲哀的现实
    2020-12-15 18:11

    Take a look at button_to.

    Example shows you can do something like

    <%= button_to "Some Button", :method=> "someButton" %>
    

提交回复
热议问题