I asked this question here:http://www.ruby-forum.com/topic/132105#new
but let me try to put it more succinctly.
Below I show a controller action controller meant to save a new item
with its association. The page with the orignating form has displays of
other instances of the same model type and parent and associations
If a user enters information for a fposition with a field entry that
fails validation, I can't get the error messages and information back to
If I just render the view, the view seems to be missing all the instance
variables it needs. (instance variables only last one action I guess).
If I redirect to the view action that initially rendered the view, that
action creates a new object without the errors and partially completed
data from the first attempt.
@fposition = Fposition.new(params[:fposition])
@formation = session[:formation]
@coach = session[:coach]
#need help here
if @fposition #! Help here please...need a condition !!!
@fposition will not be nil because it an Fposition object.(a new
Fposition object can be nil?) maybe you want to do @fposition.valid?