Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

render partial to jquery template

View _partial.html.erb
1 2 3 4 5
class SomeController < ApplicationController
def show
@template_model = SomeModel.new(:value => "${value}")
end
end
View _partial.html.erb
1 2 3 4 5 6 7 8 9 10 11
<html>
<head>
<script id="some-template" type="x-jquery-tmpl">
<%= render :partial => "some/partial", :locals => {:model => @template_model} %>
</script>
 
<script language="javascript" type="text/javascript">
$("#some-template").tmpl({value: "this is some data"});
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.