Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
render partial to jquery template
this is a partial. <%= model.value %>
class SomeController < ApplicationController
def show
@template_model = => "${value}")
<script id="some-template" type="x-jquery-tmpl">
<%= render :partial => "some/partial", :locals => {:model => @template_model} %>
<script language="javascript" type="text/javascript">
$("#some-template").tmpl({value: "this is some data"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment