Im trying to declare a coffescript function and call it later in the code. I'm pretty new to this, and can't seem to find anything on it.
Here is the code im working on, as you can see I try to call the square function:
coffee:
@square = (x) -> x * x
p square(3)
Here i want to get a p-tag containing "9"
You can do it like so
But !!NEVER EVER!! write such horrible things. In ROR Slim templates are for ruby only. And please don't define any methods there.