Skip to content

When rendering a partial from tasks.js.coffee.erb - undefined, render #1370

@dreamr

Description

@dreamr
// /Users/james/development/me/railstar/app/assets/javascripts/tasks.js.coffee.erb
$("#add_objective").live 'click', (event) ->
  $("#objectives").append -> 
    "<%= render :partial => '/tasks/objective', :object => Objective.new %>"

Error compiling asset application.js:

NoMethodError: undefined method `render' for #<#<Class:0x00000100ac4a08>:0x00000100d7d678>
  (in /Users/james/development/me/railstar/app/assets/javascripts/tasks.js.coffee.erb)

I converted it to js.erb and from coffeescript to jquery and I get the same error. I can evaluate some things in the brackets though

<%= 1+1 %> compiles the js just fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions