Reputation: 6300
So I have a app/assets/javascript/sites.js.coffee.erb
file.
There I do:
#lots of stuff
formData: '<%= @s3_direct_post[:fields] %>',
#and more stuff
which ends in:
undefined method `[]' for nil:NilClass
which seems to suggest that rails is NOT preprocessing the erb file. I tried leaving out the .erb extension, leaving app/assets/javascript/sites.js.coffee
, but that didn't help either.
How does correct rails 4 preprocessing work???
I'm confused as the sites_controller correctly creates the @s3_direct_post
object,
and it can be used in app/views/sites/upload.html.erb
just fine...
Upvotes: 0
Views: 2501
Reputation: 6300
Here I found answers which I implemented :)
http://railscasts.com/episodes/324-passing-data-to-javascript
Upvotes: 1