This code snippet is extracted from a controller route. The intent is to render the partial after the form has being saved.
post :create, :provides => :js do
@note = Note.new(params[:note])
if @note.save
"$('form').after('<p>#{ partial("notes/elikem") }</p>')"
# Not sure why the partial above does not load
else
"alert('Note was not created');"
end
end
This is the exact code we are concerned with... the partial renders when called from a view.
"$('form').after('<p>#{ partial("notes/elikem") }</p>')"
Useful reference: http://padrinorb.com/guides/application-helpers/ujs-helpers/