I am struggling to understand when and when not to use symbols in Rails. I understand that symbols are not too dissimilar from a string without many of the methods. I also understand the symbols make good keys as symbols of the same name occupy one address in memory.
What I struggle to understand is why Rails decides to use symbols in some cases. If I had the callback
before_action :ask_stack_overflow_question
def ask_stack_overflow_question
puts "why did I just use a symbol?"
end
I don't quite understand why the treat the method as a symbol? Why would I need to keep a method constant?
I can't find any answer to this in the documentation.
Thank you