Rails check_box does not hold data needed to update the model -


i have view contains form used create model. code worked fine until added attribute model obtained using checkbox. now, code fails, debate_type not updated , therefore model not created:

the code i've added prevents creation of model:

model:

  validates_presence_of :debate_type 

view:

  <div class="field">     <%= f.check_box :debate_type, {}, "technical", "management" %>     <%= f.label :debate_type, "technical" %>   </div> 

i not sure why attribute debate_type not updated.

in controller, forgot permit debate_type parameter.

def subject_params   params.require(:subject).permit(:name, :body, :parent_id, :debate_type) end 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -