NoMethodError in Admin::Departments#edit

Showing /opt/app/views/admin/departments/_form.html.erb where line #7 raised:

undefined method `error_message' for #<ActionView::Base:0x000000000979a0>
Extracted source (around line #7):
5
6
7
8
9
10
              
<%= f.text_field :name, placeholder: "Name", required: true ,:minlength=> 1%>
<p class="error affiliation-name affiliation-errors hidden">The Field must contain a minimum of 1 character</p>
<%= error_message :name, f.object.errors %>
<br/>
<fieldset>
<legend>New Department Role:</legend>

Trace of template inclusion: #<ActionView::Template app/views/admin/departments/edit.html.erb locals=[]>

Rails.root: /opt

Application Trace | Framework Trace | Full Trace

Request

Parameters:

{"id"=>"36"}

Response

Headers:

None