I want to render action inside my erb template.
<div>
<%= render :controller => :tags, :action =&g开发者_StackOverflow中文版t; :tag_cloud %>
</div>
This block throws exception: undefined method `formats' for nil:NilClass
Also I want to tag_cloud action to be rendered from cache. Is that possible?
Regards, Alexey Zakhaov
Just remind that render :action does not run the tags controller, it just renders the tag_cloud erb with the variables you have defined in your current controller. So you have to define in your controller all the instance variables you need in your template, including the one on which the formats method is called.
精彩评论