Displaying 1 result from an estimated 1 matches for "all_good".
Did you mean:
aldgood
2006 Jan 02
1
Dealing with collections of model objects
...p/controllers/request_controller.rb -------
class RequestController < ApplicationController
def make_request
# session[:resource] has been defined elsewhere....
@answers = session[:resource].prepare_answers
end
def complete_request
answers = Array.new
all_good = params[:answers].all? { |a|
a = Answer.create!(a)
}
if all_good
redirect_to :action => ''complete_request''
else
render :action => ''make_request''
end
end
end
-------
------- app/views/...