Я не могу получить частичное для повторения - объект, который я передаю, никогда не соответствует частичным переменным
Метод контроллера для ajax
def news
@fixture = Fixture.find(params[:fixture_id])
home_team = Team.find(@fixture.home_team)
away_team = Team.find(@fixture.away_team)
@story = Story.find(:all, :conditions => "team_id = #{home_team.id}", :order => "dated DESC", :limit => 5)
respond_to do |format|
format.js do
render :update do |page|
page.replace_html "home_id_fixture_#{@fixture.id}", :partial => "story/story", :object => @story
end
end
end
end
частичный код
<div id="story-vote-<%= story.id %>">x</div>
<div id="story-title"><%= story.title %></div>
ошибка
ActionView::TemplateError (undefined method `title' for []:Array) on line #3 of app/views/story/_story.erb:
1:
2: <div id="story-vote-<%= story.id %>">x</div>
3: <div id="story-title"><%= story.title %></div>
4:
5:
app/views/story/_story.erb:3
app/controllers/hub_controller.rb:75:in `__instance_exec0'
app/controllers/hub_controller.rb:74:in `news'
app/controllers/hub_controller.rb:72:in `news'