I have a wizard which consists of two pages. To keep it simple let’s say
that the first page asks the user to select a state from the drop down
In case the user doesn’t select any state, an error message needs to be
Ideally I would like to do something like this.
selected_value = params[:addevent][:state_id]
if selected_value == “-1”
errors.add(:state_id,“Please select a valid state”)
# go to the next page
But errors is not available in the controller. It’s available only in
model. I could use flash[:notice] but using errors would have have
It would have kept everything consistent with the other error message.
Anything I’m missing here.