Skip to content

Instantly share code, notes, and snippets.

@paul
Created September 22, 2008 17:26
Show Gist options
  • Save paul/12062 to your computer and use it in GitHub Desktop.
Save paul/12062 to your computer and use it in GitHub Desktop.
{
:_type => Template,
:id => template.path,
:href => uri(:controller => :templates, :action => template.path),
:name => template.name,
:description => template.description,
:max_associations_per_configuration => template.max_associations_per_configuration,
:questions_href => questions_url(template),
:restricted_platforms => template.restricted_platforms,
:restricted_clients => template.restricted_clients
}
{
:href => uri(:templates),
:item_count => @templates.size,
:items => @templates.map { |template|
partial(:template, :with => template)
}
}
module Merb::Template
class RubyJson
def self.compile_template(io, name, mod)
mod.class_eval <<-RUBY, io.path
def #{name}
json = #{io.read}
json.to_json
end
RUBY
name
end
module Mixin
end
Merb::Template.register_extensions(self, %[rj])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment