开发者

How can I reference a partial form another folder?

开发者 https://www.devze.com 2023-01-28 07:36 出处:网络
/views/category/_blah.html.erb /views/users/show.html.erb Inside of show, I wan开发者_Python百科t to render the partial _blah but I am getting an error as it cant\' find it.try using

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

Inside of show, I wan开发者_Python百科t to render the partial _blah but I am getting an error as it cant' find it.


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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消