Last active
December 15, 2015 03:09
-
-
Save knomedia/5192408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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