0

I see two difference experience in rails. In multiple projects permit_params are defined in protected and in multiple projects they are defined in private

What is the difference between these two strategies?

Please explain briefly

1 Answers1

0

private

The type or member can only be accessed by code in the same class.

protected

The type or member can only be accessed by code in the same class or struct, or in a derived class.

An example of a private method: http://matthodan.com/2010/08/08/ruby-private-methods-vs-protected-methods.html

Seifer
  • 247
  • 3
  • 10