Can't render a rails partial inside CoffeScript file
coffeescript, ruby-on-rails
Solution
Coffeescript files aren't processed within the context of a request, therefore you won't be able to access the render method.
Problem
I try something like this on CoffeScript file located the assets pipeline. ``` <%= escape_javascript(render partial: "shared/mypartial")%> ``` But I get the following error ``` throw Error("NoMethodError: undefined method `render' for #<# <Class:0x007fb68f801a40>:0x007fb68d3c3fe8>\n (in /Users/user/Sites/app/app/assets/javascripts/application/app.js.coffee.erb)") ``` Any idea why is not getting the render method?