Created
January 13, 2013 00:50
-
-
Save umdstu/4521427 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
create.js.erb => | |
alert("<%= @cart.id %>"); | |
$('#cart').html("<%= render @cart %>"); | |
_cart.html.erb => | |
<%= Time.now %> |
Started POST "/cart_products?product_id=1" for <> at Sat Jan 12 19:10:33 -0600 2013
Processing by CartProductsController#create as JS
Parameters: {"product_id"=>"1", "authenticity_token"=>"8W60IPjespoVxIojBXasRn7Gd3giSLRtwdfYPoY3/Kg="}
Rendered carts/_cart.html.erb (0.1ms)
Rendered cart_products/create.js.erb (0.5ms)
Completed 200 OK in 29ms (Views: 1.3ms | ActiveRecord: 1.4ms)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If <%= Time.now %> is placed in the partial, it gets rendered.
If
<%= Time.now %> | <%= cart.id %>
gets placed in the partial, nothing gets rendered, and the alert above doesn't occur.