Error validations from child model Ruby on Rails
<p>I got a problem which I can't solve. I made two models; one model called Film is the parent model and another model called Review is the child model. I got validation conditions on the child model but it does not display on the view.</p>

<p>Film model</p>

<pre><code>class Film &lt; ApplicationRecord
has_many :reviews

validates_presence_of :filmtitle,  presence: true
validates_presence_of :filmdescription,  presence: true
validates_presence_of :filmdirector,  presence: true
validates_presence_of :filmrating,  presence: true
validates_presence_of :filmstarname,  presence: true 
end
</code></pre>

<p>Review model</p>

<pre><code>class Review &lt; ApplicationRecord
validates :rating,  presence: true
validates :commenter,  presence: true
validates :body,  presence: true
belongs_to :film
end
</code></pre>

<p>Review Controller</p>

<pre><code>class ReviewsController &lt; ApplicationController
def create
    @film = Film.find(params[:film_id])
    @review = @film.reviews.create(review_params)
    redirect_to film_path(@film)
end

private
def review_params
  params.require(:review).permit(:commenter, :body, :rating)
end
end
</code></pre>

<p>Film show.html.erb</p>

<pre><code>  &lt;% if @film.errors.any? %&gt;
&lt;div id="error_explanation"&gt;
  &lt;h2&gt;
    &lt;%= pluralize(@film.errors.count, "error") %&gt;&lt;/h2&gt;
  &lt;ul&gt;
    &lt;% @film.errors.full_messages.each do |msg| %&gt;
      &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
    &lt;% end %&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
&lt;%= form_for([@film, Review.new]) do |f| %&gt;
&lt;p&gt;
 &lt;%= f.label :commenter %&gt;&lt;br&gt;
 &lt;%= f.text_field :commenter, :placeholder =&gt; 'Your name' %&gt;
&lt;/p&gt;
 &lt;p&gt;
 &lt;%= f.label :body %&gt;&lt;br&gt;
 &lt;%= f.text_area :body, :placeholder =&gt; 'Your comment' %&gt;
 &lt;/p&gt;
  &lt;p&gt;
    &lt;%= f.label :rating %&gt;&lt;br&gt;
    &lt;%= f.select :rating, ['1 Star', '2 Stars', '3 Stars', '4 Stars', '5    Stars'] %&gt;
 &lt;/p&gt;
  &lt;p&gt;
 &lt;%= f.submit %&gt;
  &lt;/p&gt;
 &lt;% end %&gt;
</code></pre>

<p>Film Controller</p>

<pre><code>class FilmsController &lt; ApplicationController
before_action :set_film, only: [:show]

# GET /films
# GET /films.json
def index
@films = Film.all.paginate(page: params[:page], per_page: 30)
@reviews = Review.new
end

# GET /films/1
# GET /films/1.json
def show
end

# GET /films/new
 def new

 end

 # GET /films/1/edit
def edit
 end

# POST /films
# POST /films.json
def create

end

# PATCH/PUT /films/1
# PATCH/PUT /films/1.json
def update

end

# DELETE /films/1
# DELETE /films/1.json
def destroy

end

private
# Use callbacks to share common setup or constraints between actions.
def set_film
  @film = Film.find(params[:id])
end

 # Never trust parameters from the scary internet, only allow the white list   through.
def film_params
  params.require(:film).permit(:filmtitle, :filmdescription)
end
 end
</code></pre>

<p>route.rb</p>

<pre><code> Rails.application.routes.draw do
  resources :films do
resources :reviews
  end


  resources :rentals
  resources :buys
  resources :admin
  resources :adminrentals
   resources :adminfilms
   resources :logins
  resources :admins_login
   resources :games


    get '/adminCool' =&gt; 'admins_login#index'  

     get '/adminlogin' =&gt; 'admins_sessions#new'
     post '/adminlogin' =&gt; 'admins_sessions#create'  
     get '/adminlogout' =&gt; 'admins_sessions#destroy'

   get '/adminsignup' =&gt; 'admins#new'
     post '/admins' =&gt; 'admins#create'


  get '/login' =&gt; 'sessions#new'
 post '/login' =&gt; 'sessions#create'
 get '/logout' =&gt; 'sessions#destroy'

 get '/signup' =&gt; 'users#new'
 post '/users' =&gt; 'users#create'

 get '/cool' =&gt; 'logins#index'  



end
</code></pre>