mardi 1 décembre 2015

How to dispaly selected value in edit page

How to dispaly selected value in edit page. in my form i need to display selected value. it is not selecting the value which i selected and submitted. else it shows "please select Study material".

This is my StudyMaterial model

class StudyMaterial < ActiveRecord::Base TYPES = ['Question Paper', 'Book', 'Audio', 'Video'] enum study_material_type: TYPES end

This is my 'form.html.erb'

<select class=" required form-control" name="study_material[study_material_type]" id="study_material_study_material_type" data-validation="required" data-validation-error-msg="Select study material"> <option value="">Please select study material</option> <option value="Question Paper">Question Paper</option> <option value="Book">Book</option> <option value="Audio">Audio</option> <option value="Video">Video</option> </select>

How to dispaly selected value in edit page. I am getting this error when i click edit studymaterial page

enter image description here

Please help me to solve this error

Aucun commentaire:

Enregistrer un commentaire