Hi,From within an action called manager within a controller called storedorders, I want to render to the view for the manger action of controller orders. It really seems like the following syntax should work: (within the StoredordersController manager method...) respond_to do |format| format.html {render :controller => ''orders'', :action => ''manager''} # format.xml { head :ok } end But I get the following message: "Template is missing Missing template storedorders/manager.erb in view path app/views" Why is it even looking when I told it to render a different view? This however works: respond_to do |format| format.html {render ''orders/manager''} # format.xml { head :ok } end It really seems like either syntax should be valid. What am I missing? Thanks, Tim --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Argument to the "render()" method does not recognises the ":controller" key. You might be confusing it with arguments to "redirect_to()" method. Checkout http://api.rubyonrails.org/classes/ActionController/Base.html#M000658 for more information. On Jul 27, 9:49 am, Tim Rand <timra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi,From within an action called manager within a controller called > storedorders, I want to render to the view for the manger action of > controller orders. > > It really seems like the following syntax should work: > > (within the StoredordersController manager method...) > > respond_to do |format| > format.html {render :controller => ''orders'', :action => ''manager''} > # format.xml { head :ok } > end > > But I get the following message: > > "Template is missing > Missing template storedorders/manager.erb in view path app/views" > > Why is it even looking when I told it to render a different view? > > This however works: > respond_to do |format| > format.html {render ''orders/manager''} > # format.xml { head :ok } > end > > It really seems like either syntax should be valid. What am I missing? > Thanks, > Tim
Thanks for answering Vikrant, Did render change recently, because the internet is littered with advice saying render :controller => ''con_name'', :action => ''action_name'' is valid syntax. And if you can say render ''controller/action'', why not allow it to be stated the other way too? Tim On Jul 26, 10:11 pm, Vikrant <nas...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Argument to the "render()" method does not recognises the > ":controller" key. You might be confusing it with arguments to > "redirect_to()" method. > Checkouthttp://api.rubyonrails.org/classes/ActionController/Base.html#M000658 > for more information. > > On Jul 27, 9:49 am, Tim Rand <timra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi,From within an action called manager within a controller called > > storedorders, I want to render to the view for the manger action of > > controller orders. > > > It really seems like the following syntax should work: > > > (within the StoredordersController manager method...) > > > respond_to do |format| > > format.html {render :controller => ''orders'', :action => ''manager''} > > # format.xml { head :ok } > > end > > > But I get the following message: > > > "Template is missing > > Missing template storedorders/manager.erb in view path app/views" > > > Why is it even looking when I told it to render a different view? > > > This however works: > > respond_to do |format| > > format.html {render ''orders/manager''} > > # format.xml { head :ok } > > end > > > It really seems like either syntax should be valid. What am I missing? > > Thanks, > > Tim
I don''t remember that "render()" ever worked that way. Can I have an example? On Jul 27, 1:36 pm, timr <timra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks for answering Vikrant, > Did render change recently, because the internet is littered with > advice saying > > render :controller => ''con_name'', :action => ''action_name'' > > is valid syntax. And if you can say render ''controller/action'', why > not allow it to be stated the other way too? > Tim > > On Jul 26, 10:11 pm, Vikrant <nas...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Argument to the "render()" method does not recognises the > > ":controller" key. You might be confusing it with arguments to > > "redirect_to()" method. > > Checkouthttp://api.rubyonrails.org/classes/ActionController/Base.html#M000658 > > for more information. > > > On Jul 27, 9:49 am, Tim Rand <timra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi,From within an action called manager within a controller called > > > storedorders, I want to render to the view for the manger action of > > > controller orders. > > > > It really seems like the following syntax should work: > > > > (within the StoredordersController manager method...) > > > > respond_to do |format| > > > format.html {render :controller => ''orders'', :action => ''manager''} > > > # format.xml { head :ok } > > > end > > > > But I get the following message: > > > > "Template is missing > > > Missing template storedorders/manager.erb in view path app/views" > > > > Why is it even looking when I told it to render a different view? > > > > This however works: > > > respond_to do |format| > > > format.html {render ''orders/manager''} > > > # format.xml { head :ok } > > > end > > > > It really seems like either syntax should be valid. What am I missing? > > > Thanks, > > > Tim
Apparently Analagous Threads
- Does Set Block IO tune take effect in the same session.
- Error while connecting to Oracle using RODBC package
- how to open excel 2007 (.xlsx) file in R
- Can I save R graphs as a R objects
- padawan seeks advice from jedi masters to create toggle box via ajax/rjs before slitting wrists with ruby powered light-saber.