Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save Mustache Templates in Database #3

Open
shenoudab opened this issue Jan 16, 2011 · 1 comment
Open

save Mustache Templates in Database #3

shenoudab opened this issue Jan 16, 2011 · 1 comment

Comments

@shenoudab
Copy link

Dears,

kindly, Is there a way to save Mustache Templates in Database as (CouchDB) and how to do so ?
what is the advantages when using mustache instead of Liquid or ERB in Rails App ? is there any performance figures ?

Thanks,
Shenouda Bertel

@parallel588
Copy link

Hi,
Please, have a look at my variant on https://github.com/parallel588/mustache_rails3, it helps save Mustache Templates in Database.

To work with Database, you need to put:
Mustache::Rails::Config.template_from_store = Proc.new{ |t| Page.find_by_slug(t).try(:content) || "not found" }
Mustache::Rails::Config.partial_from_store = Proc.new{ |t| Snippet.find_by_slug(t).try(:content) || "not found"}
in RAILS_ROOT/config/initialize/mustache.rb

Cheers,
Max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants