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
Just circling back to finish this up. Ultimately I solved this by using link_to but using jQuery to make it look like a button. @kishie, if you're saying you made this work with button_to I'd like to see the code, but as I like jQuery it's solved as far as I'm concerned (for this app, anyway.)
Here's the code in Article#show view. (The class is what makes it look like a button via jQuery.)
<%= link_to "New Request", new_work_request_path(:article_id => @article.id), :class => "ui-button" %>
Here's the code in Work_Request controller's new method:
if !params[:article_id].blank?
@work_request.article = Article.find(params[:article_id])
end
Then the Work_Request#new view renders it properly.