I am trying to pass query parameter with new action http://localhost:3000/education_informations/new?user_id=10 and also set form validation on it. when form submit failed so its display error but url is changes like http://localhost:3000/education_informations so I want to same customize url and pass query parameter with user_id. Please help me
controller code give below
def create
@edu_info = EducationInformations.new(educational_params)
if @edu_info.save
#flash[:notice] = 'Vote saved.'
redirect_to @edu_info
else
render 'new'
end
end
Aucun commentaire:
Enregistrer un commentaire