templates - Using liquid in Rails 3 -


I'm building a rail blog engine for the purpose of learning. I want to use liquid as a template engine. I have something like this

  ## posts_controller.rb ... df index @posts = post.he end ... ## post / index.html.liquid {% posting in post For doing so I found the following error:  
  Undefined local variable or method `template '{{post.title}} {{post.title}}   < P> 'for # & lt; PostsController: 0x103d16290 & gt;   

I had already loaded the RBI in Starter / Liquid. Please tell me what is my problem as I know that you have liquid methods for the characteristics (in your case for your 'title')

. Try to do something like

  class posts & lt; ActiveRecord :: Base Liquid_Cools: End of Title   

See more.

  class posts & lt;  

Liquid :: drop end

** Since BTW you have to claim the missing template variable If there is an error, make sure your liquid rendering part is as follows

(directly copied from liquid doctor) template @ template. Render ('name' = & gt; 'tobi') # Pars and compile;

  @ template = liquid :: Template.parse ("hi {{name}}" # # # output = & gt; Provides; 

Comments