As you may expect, when validation fails, I created a redirect.
I can access it in the view with out a problem, but I would like to do something different. I have an ErrorPartial.blade.php, which I would like to be passed to my search view.
return View::make('search.searchForm') ->with('title', 'Search Page') ->with('components', Subject::select('Component')->distinct()->get()) ->with('measurementRow',$measurementRow) ->with('races', Race::parseRaceTable()) ->with('errorPartial', View::make('errorPartial') ->with('errors',$v->messages()) ->render()) ;
The Problem is I don't have access to $v in this controller function. Can I access the errors that are going to be passed to the view some how? I've tried this:
return Redirect::to('search')->withErrors($v->messages()) ->with('v', $v);
But I get this error.
Serialization of 'Closure' is not allowed
I could just create the Partial view in my search view but I was wondering if their was a way to do it this way. If anyone knows which would be more efficient or GPP then I wouldn't mind knowing that as well.