Skip to content

Instantly share code, notes, and snippets.

@oozzal
Created August 5, 2014 11:58
Show Gist options
  • Save oozzal/8a0ebc18393ea859c33d to your computer and use it in GitHub Desktop.
Save oozzal/8a0ebc18393ea859c33d to your computer and use it in GitHub Desktop.
.js.erb file not executing solution
# http://stackoverflow.com/questions/18936633/rails-update-js-erb-not-executing-javascript
# http://stackoverflow.com/questions/3412375/jquery-ajax-haml-js-erb-files-not-firing
# IN SHORT:
# use the following code in controller:
respond_to do |format|
format.html
format.js {render layout: false}
end
# notice the "render" part, it says not to load the layout file, which is layouts/application.[haml/html.erb] by default
# However, the error is usually due to the use of haml templating
@AlbertMontolio
Copy link

Does it mean that we can't use haml in our views for that to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment