Я всегда получаю следующее сообщение об ошибке:AbstractController :: DoubleRenderError в рельсах 3
AbstractController::DoubleRenderError (Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return".):
ошибка происходит, когда это идентификатор равен нулю первый, но не второй раз ...
def calc_next
id = next()
if id.nil?
id = next_next()
if id.nil?
render :layout => false, :format => :js
else
redirect_to :action => "view", :id => id, :format => :js
end
else
redirect_to :action => "view", :id => id, :format => :js
end
end
Я не вижу проблемы в этом переадресации, так как внешняя в порядке. Даже с помощью отладчика не два переназначения в то же время ...
Любая помощь приветствуется ... Markus
Классный, спасибо, вы дали мне точно правильный намек, функция next_next() была редирект действие уже интегрировано ... – Markus