votable.coffee:
set_votable_hooks = (vote_area_name) ->
...
questions.coffee:
vote_area_name = 'xyz'
$(document).ready(set_votable_hooks(vote_area_name))
I want function to be called on document ready. I know that every coffee file is placed inside a function, so its contents are not available inside other. I've read that solution is to make set_votable_hooks global or use namespaces, couldn't manage them to work, because I'm new to js. But as I understand, preferred solution is to use namespaces in order to not pollute global object.