dimanche 19 février 2017

avoid data type check in rails form

I have typeahead autosuggest field in my rails form for taking the name of person but in the model i have id for the person but the problem is when i create the person object and redirect to the same form its giving me an error that undefined method `person_name' for Workers Table

<%= form_for :worker, :url => {:action => :create_worker} do |f|  %>

    <%= f.text_field ("person_name"),:class => "typeahead form-control",style:"width:100%;",:placeholder=>"Enter name" , :data => {:provide => "typeahead"}%>

<%end%>

Any suggestion would be a great help

Aucun commentaire:

Enregistrer un commentaire