Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reference a partial form another folder?

/views/category/_blah.html.erb /views/users/show.html.erb

Inside of show, I want to render the partial _blah but I am getting an error as it cant' find it.

like image 342
Blankman Avatar asked Dec 06 '10 05:12

Blankman


1 Answers

try using

<%= render :partial => "category/blah" %>

inside your view.

(This is definitely good coding practice, as you'll find it in the "Rendering Partial Collections" page in the first Rails Guide.)

like image 80
Sam Ritchie Avatar answered Oct 25 '22 03:10

Sam Ritchie