RailsCasts Pro episodes are now free!

Learn more or hide this

:marko => tunjić's Profile

GitHub User: mtunjic

Comments by :marko => tunjić

Avatar

Superb cast.

For older Rails version:

ruby
module MustacheTemplateHandler
  def self.call(template)
    if template.extension == "mustache"
      "Mustache.render(#{template.source.inspect}, object).html_safe"
    else
      "#{template.source.inspect}.html_safe"
    end
  end
end
ActionView::Template.register_template_handler(:mustache, MustacheTemplateHandler)

---- View

ruby
%ol
    - @users.each do |user|
      = render "user", :object => user.attributes.symbolize_keys