Hello If a certain action in a certain controller is private it should return an "Unknown action" error if you type its path in the browser. But if it has a corresponding view, the browser actually shows the view. Why is that so? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Oct-08 00:06 UTC
Re: Private Actions that have Views aren''t that private
On 8 Oct 2007, at 00:05, Onildo wrote:> > Hello > > If a certain action in a certain controller is private it should > return an "Unknown action" error if you type its path in the browser. > But if it has a corresponding view, the browser actually shows the > view. Why is that so?Because ActionController basically does if self.class.public_methods.include?(method) #perform the action elsif template_exists?(method) #render template else raise ''Unknown action'' end Fred> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jeremy McAnally
2007-Oct-08 03:54 UTC
Re: Private Actions that have Views aren''t that private
Yup. This is also true if there''s a template without a controller method either. --Jeremy On 10/7/07, Onildo <onildo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello > > If a certain action in a certain controller is private it should > return an "Unknown action" error if you type its path in the browser. > But if it has a corresponding view, the browser actually shows the > view. Why is that so? > > > > >-- http://www.jeremymcanally.com/ My books: Ruby in Practice http://www.manning.com/mcanally/ My free Ruby e-book http://www.humblelittlerubybook.com/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---