为所有页面呈现动作(即“新闻”)的正确方法是什么?我想要这样的东西:
应用程序.html.erb
<!DOCTYPE html>
<html>
...
<div class="side">
<%= render :template => 'news/index' %>
</div>
<div class="main">
<%= yield %>
</div>
...
</html>
和 news_controller.rb
class NewsController < ApplicationController
def index
@news_previews = News.news_for_quick_preview
render :layout => false
end
end
但现在它不起作用。@news_previews => 无