I have a fairly basic form ‘new’ that assigns an @client instance
variable based on information in the session’s user data.
@client = User.find(:first, :conditions => [“id = ?”,
‘new’ passes on a ‘case’ parameter to ‘create’ in order to create a case
@case = Case.new(params[:case])
redirect_to :action => ‘show’, :id => @case
render :action => ‘new’
If @case is valid, it saves and is effectively redirected. If @case
doesn’t pass validation, however, @client comes up nil when it
re-renders ‘new’, giving me an error loading the view. I need to use
render rather than redirect_to in order to get flash messages (right?).
How might a be able to get around this?