I'm trying to access some ruby instance variables through a coffeescript file. At what point do instance variables become defined? For example, when I try the following:
$(window).load () ->
$('#s3-uploader').S3Uploader
additional_data: {project_id: <%= @project.id %>, step_id: <%= @step.id %>, user_id: <%= current_user.id %>}
I get the error
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
(in /images.js.coffee.erb)
I know that @project should be defined, though, since I use it on the page when it's loaded. What am I doing wrong?