Displaying 1 result from an estimated 1 matches for "get_instance_vari".
2006 Feb 01
4
Custom view helpers
...passed as symbols like this:
custom_helper(:person, :name)
and Ruby rightfully complains that the symbol person does not have a
method named name. Second try was this. @person is an instance
variable of the controller, right?
custom_helper(obj, meth)
''some_string'' + self.get_instance_variable(obj).send(meth) +
''some_other_string''
end
and I get "`person'' is not allowed as an instance variable name".
How does Rails do that? I can see the text_field being Implemented
like this:
InstanceTag.new(object, method, self)
but I have no idea what t...