What is the purpose of making instance variables start with an underscore like the following?
@_variables_name
Ruby does not have a special interpretation of instance variables that start with an underscore, like PHP has a special meaning for vars that start and end with double underscores (e.g. __FILE__).
So, @_instance_var has no special meaning. Rails internally uses it to distinguish private/protected variables that other should not modify/access.
But, there is no community-wide convention yet. So, you can use the Rail's convention or make up your own use for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With