lundi 25 juillet 2016

Ruby on Rails:Get params with attribute which not in model

I have a field which is not in my model , but it is in my _form.html.erb .Now i want to get it from form, but i get this error :
undefined method 'description' for Object
My controller:
def job_params @job_params ||=params.permit(:description) (description is not an attribute in job model ).
How can i get description ?? My form:

<%= form_for(@job) do |f| %>
<div class="field">
  <%= f.label :description %><br>
  <%= f.text_field :description %>
</div>

Aucun commentaire:

Enregistrer un commentaire