Private Actions that have Views aren't that private

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?

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

Yup. This is also true if there's a template without a controller method either.

--Jeremy