Rails convention urges everyone to name models, controllers and other things the way they are named in real life.
I've run into a problem, where my form can't recognize the right form of instance variable.
I have Fish model and corresponding fish controller.
class FishController < ApplicationController
def index
@fish = Fish.new
end
end
Then when I get on my form, I get the error.
<%= form_for @fish do |f| %>
<%= f.label :type %>
<%= f.text_field :type, class: "form-control" %>
<% end %>
How can I resolve the issue? Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire