routes for new resources

11 views
Skip to first unread message

John Merlino

unread,
Aug 17, 2012, 11:32:02 AM8/17/12
to Ruby on Rails: Talk
Does anyone know what the controller code would look like for a route
like this:

resources :reports do
new do
post :preview
end
end

and a helper that looks like this:

preview_new_report_path

thanks for response

John Merlino

unread,
Aug 17, 2012, 11:38:38 AM8/17/12
to Ruby on Rails: Talk
actually, let me rephrase this. That route points to the preview
action of a reports controller, but why is it a POST for a new
resource?

bertly_the_coder

unread,
Aug 18, 2012, 3:53:42 PM8/18/12
to rubyonra...@googlegroups.com
Hey John, Haven't you defined it as a POST in this line? 
post :preview 
Reply all
Reply to author
Forward
0 new messages