I'm using this gem - TMDb - to build a simple app.
When I visit this URL i get the error:
.../movies/97857/movie_reviews/new
Form:
<%= form_for @movie do |movie_form| %>
<%= fields_for :movie_review, @movie.movie_review do |movie_review_fields| %>
Title : <%= movie_review_fields.text_field :title %>
<% end %>
<%= f.submit %>
<% end %>
form_for
expects anActiveRecord
object (which has an instance method calledmodel_name
).@movie
is a non-ActiveRecord object that comes from the gem you're using and it doesn't have a method calledmodel_name
. That's why you get the error.I see that you also have a
Movie
model, but that is not what is used here. From your controller:Since I don't know what you're trying to achieve, I can only point out why you get the error.