I have a Dashboard controller and in the index method i have @message = Message.new( Message is my model )…In my index.html.erb i have a form
<%= form_for @message do |f| %>
<%= f.text_field :message %><br>
<%= f.submit "Send" %>
<% end %>
and i get an error at first line of the form “undefined method `messages_path'”…
I don’t have a new method in my controller
Pls help
Do you have a
resources :messagesroute inconfig/routes.rb? The error is happening when Rails tries to create the form’s submission route from the class of the argument toform_for