I come from a PHP background and I’m used to calling a class’ internal methods with $this->methodName(), but I can’t seem to find the syntax for doing the same in Rails. I want to do something like the following in a controller:
class Foo
def bar
#call self.baz
end
def baz
#some code
end
end
What is the proper syntax for the method call? Also, if there is a good place for just learning basic syntax for Ruby/Rails, please share. I’m finding it frustrating just trying to find simple syntax features.
Use simply
bazorself.baz.selfis equivalent to$thisin PHP.