If anyone is interested I have been able to patch the .liquid
extension to work with Rails 2.2.2 - this patch works with both the
gem (1.9.0) or latest from github, in either case try using the
following files;
config/initializers/liquid.rb =>
http://pastie.org/363312
lib/liquid_filters.rb =>
http://pastie.org/363315
Now you can use something like this in your controller actions;
def test
@posts = Post.find(:all)
render :template => 'posts/test.liquid', :locals => {'posts' =>
@posts}
end
Heres an overview of the changes I made;
liquid.rb
-- Overrides LiquidView and registers template handler
-- adds self.call method to LiquidView (needed for Rails 2.2.2)
-- includes ApplicationHelper - also hard-codes in a filter class to
use :filters => [LiquidFilters, (is there a better way of passing the
filters in?)
-- local_assigns now filled by local_assigns_for_rails_less_than_2_1_0
- or template.locals
liquid_filters.rb
-- Just a place to put you're filters for use in templates, example
shows with using something like number_to_currency
This is by no means an official liquid patch or anything. Any changes
or help with the above patch is appreciated.
Regards
Matt