
November 6th, 2009, 02:19 AM
|
|
|
ROR confusion using methods
Okay, I am very new to ruby. I have written several standard ruby programs and now I am starting to learn ROR. I am a bit confused though. In a standard ruby program I create a method and then in the main program I pass a variable to the method and have the method print out a value. Now, I know I use the controller file and the index file to do this, but I am unsure exactly how to include the method and to call it.
def print(value)
puts(value)
end
print(10)
I need to do something like this in ROR, but I am not sure just how. It is simple in just a standard ruby program. Any help would be appreciated.

|