Hello, Just wondering if someone here as successfully ported Liquid to use with a database. I would like to try it out but not sure how Liquid integrates with current templates. Thanks Frank --------------------------------- Yahoo! Mail - Helps protect you from nasty viruses. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060208/2cf4f5bd/attachment.html
On 2/8/06, softwareengineer 99 <softwareengineer99@yahoo.com> wrote:> Hello, > Just wondering if someone here as successfully ported Liquid to use with a > database. I would like to try it out but not sure how Liquid integrates with > current templates. > > Thanks > FrankYou mean the liquid template engine? I''m not sure how others like Stikipad or Shopify are using them, but my little blog engine Mephisto uses liquid. svn co http://techno-weenie.net/svn/projects/mephisto/trunk # set up database.yml rake install_mephisto I don''t yet ship with decent templates (mephisto is very rough and not ready for public consumption), but here''s some samples: http://techno-weenie.net/templates.yml Here''s the liquid rendering in action: http://collaboa.techno-weenie.net/repository/file/mephisto/trunk/app/controllers/application.rb http://collaboa.techno-weenie.net/repository/file/mephisto/trunk/app/controllers/mephisto_controller.rb Liquid cannot access your model''s properties, so I wrote a #to_liquid method to return a hash. -- Rick Olson http://techno-weenie.net
Hi Rick, Thanks for your reply. I will definitely check the resource links out. A quick question, are you using file based liquid templates or storing them in the database? Thanks Frank Rick Olson <technoweenie@gmail.com> wrote: On 2/8/06, softwareengineer 99 wrote:> Hello, > Just wondering if someone here as successfully ported Liquid to use with a > database. I would like to try it out but not sure how Liquid integrates with > current templates. > > Thanks > FrankYou mean the liquid template engine? I''m not sure how others like Stikipad or Shopify are using them, but my little blog engine Mephisto uses liquid. svn co http://techno-weenie.net/svn/projects/mephisto/trunk # set up database.yml rake install_mephisto I don''t yet ship with decent templates (mephisto is very rough and not ready for public consumption), but here''s some samples: http://techno-weenie.net/templates.yml Here''s the liquid rendering in action: http://collaboa.techno-weenie.net/repository/file/mephisto/trunk/app/controllers/application.rb http://collaboa.techno-weenie.net/repository/file/mephisto/trunk/app/controllers/mephisto_controller.rb Liquid cannot access your model''s properties, so I wrote a #to_liquid method to return a hash. -- Rick Olson http://techno-weenie.net _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060209/900c1bec/attachment-0001.html
> A quick question, are you using file based liquid templates or storing them > in the database?The liquid plugin supports file-based rendering like standard rhtml files (watch the video). However, I''m rendering straight from the database. -- Rick Olson http://techno-weenie.net
I''m trying to use Liquid on a new application and it doesn''t give me an idea how to create a to_liquid method on my models. Is there any way to do it across all models? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Timothy Johnson wrote:> I''m trying to use Liquid on a new application and it doesn''t give me an > idea how to create a to_liquid method on my models. Is there any way to > do it across all models?I guess maybe what I need is a Liquid:Drop, but I can''t find out any documentation on how I add this to my Model, controller, or View? I have a model Caller which I want to pull from. I make a @caller in the controller, so what is the best way to make a Drop out of it? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/10/06, Timothy Johnson <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Timothy Johnson wrote: > > I''m trying to use Liquid on a new application and it doesn''t give me an > > idea how to create a to_liquid method on my models. Is there any way to > > do it across all models? > > I guess maybe what I need is a Liquid:Drop, but I can''t find out any > documentation on how I add this to my Model, controller, or View? > > I have a model Caller which I want to pull from. I make a @caller in the > controller, so what is the best way to make a Drop out of it? > >Mephisto uses Liquid and Drops. I just manually create a to_liquid method on my models that returns a drop. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Thanks for answering Rick, but I still don''t "get it". In your Articles you have a def to_liquid(options = {}) Mephisto::Liquid::ArticleDrop.new self, options end And similarly in other models, the name of the drop changes based upon the model. But now of course my problem is that if I drop that in my model, take out the "Mephisto" and make the drop name appropriate, it still doesn''t work. I wish I really understood the HOW of how this works, but just getting it to work would be a good step. Thanks for all your help. Hope I am not sounding too ignorant. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/10/06, Timothy Johnson <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Thanks for answering Rick, but I still don''t "get it". > > In your Articles you have a > > def to_liquid(options = {}) > Mephisto::Liquid::ArticleDrop.new self, options > endLook in lib/mephisto/liquid/article_drop.rb. There''s no magic really. Liquid gives you a blank slate, leaving you to fill in all the gaps. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---