Reputation: 637
I have following file. Displaying error:
SyntaxError (/home/ubuntu/workspace/app/views/responses/destroy.js.erb:1: syntax error, unexpected =>, expecting ')'
....append=( j render (:partial => "projects/new_response", :lo...
I cant found, what wrong with code?
destroy.js.erb
$('.responses').replaceWith('<%= j render (:partial => "projects/new_response", :locals => { project: @project } )%> ');
How write correct?
Upvotes: 1
Views: 268
Reputation: 11813
Remove the space here:
# |- HERE
render(:partial =>
Or, surround your j
method call params. Basically, Ruby can't figure out which is whose params when you have hash in your arguments list:
j(render (:partial => ...) )
Upvotes: 1