Skip to content

Instantly share code, notes, and snippets.

@knomedia
Last active December 15, 2015 03:09
Show Gist options
  • Save knomedia/5192408 to your computer and use it in GitHub Desktop.
Save knomedia/5192408 to your computer and use it in GitHub Desktop.
# Using coffeescript with erb as a :js response
# works in development doesn't seem to work in production
# app/controller/posts.rb
class Posts < ApplicationController
respond_to :html, :js
def new
@post = Posts.new
end
end
# app/views/posts/new.js.coffee
$('#some-div').append '<% = j render partial: "post" %>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment