RAILS3: Pass arbitrary parameters via button_to?

后端 未结 5 1965
北海茫月
北海茫月 2020-12-30 04:02

I\'m trying to do something very simple in my first Rails app (Rails 3) and I\'m not sure what I\'m doing wrong, or if there\'s a better approach. Can\'t find anything on th

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-30 04:29

    I just hit a similar issue and I got it to work by passing the parameter as follows:

    <%= button_to("Add WorkRequest", new_work_request_path(:article_id => @article.id), :action => "new", :method => :get)%>
    

提交回复
热议问题