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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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? On Aug 17, 11:32 am, John Merlino <stoici...-YDxpq3io04c@public.gmane.org> wrote:> 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-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Hey John, Haven''t you defined it as a POST in this line? post :preview On Friday, August 17, 2012 6:38:38 PM UTC+3, John Merlino wrote:> > 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? > > On Aug 17, 11:32 am, John Merlino <stoici...-YDxpq3io04c@public.gmane.org> wrote: > > 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 >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Er5G_H-D1f8J. For more options, visit https://groups.google.com/groups/opt_out.