sameera207
sameera207

Reputation: 16629

Liquid error "No such template" in Rails

I'm getting the following error in my Liquid view:

Liquid error: No such template 'sliders/slider' #<Liquid::LocalFileSystem:0x99319b8>

The file structure in my liquid code (which saves in the database) has the following code:

{% include 'sliders/slider' %} 

and in my view where I render the Liquid content is as follows

<%
Liquid::Template.file_system = Liquid::LocalFileSystem.new("sliders/slider")
@template = Liquid::Template.parse(<page code>) %>
<%= raw @template.render(<variables>)  %>

<%= Liquid::LocalFileSystem.new("sliders/slider") %>

And in app/views/sliders/ I have a file called '_slider.erb'.

But if I do a <%= render :partial => "sliders/slider" %> it shows the file

Am I missing something here? I'm using Rails 3 with Liquid 2.2.2 and on Linux.

Upvotes: 2

Views: 1589

Answers (1)

ghstcode
ghstcode

Reputation: 2912

I think your partial filename should be: _slider.liquid for it to work properly.

Upvotes: 2

Related Questions