Well, i'm new to rails, but not new to the rails way and i've got an error that i dont know how to fix it.
I've created the controller and than the view.
Controller:
class ReclamacoesController < ApplicationController
def new
@reclamacao = Reclamacao.new
end
end
and than, the view under Views>controllerName>new.html.erb.
<%= form_for @reclamacao do |f| %>
<%= f.text_field :titulo %>
<% end %>
The model Reclamacao exist.
I've created the resource routes for it too.
resources :reclamacoes
So, when i access /reclamacoes/new an exception is thrown.
NoMethodError in Reclamacoes#new
undefined method `reclamacaos_path' for #<#<Class:0x00000001fc0660>:0x00000001fba850>
Extracted source (around line #1):
<%= form_for @reclamacao do |f| %>
<%= f.text_field :titulo %>
<% end %>
Rails.root: /home/ubuntu/workspace/aqueleprojetoprivate/medicos
Application Trace | Framework Trace | Full Trace
app/views/reclamacoes/new.html.erb:1:in `_app_views_reclamacoes_new_html_erb___3194888715597102324_16164860'
the routes:
reclamacoes GET /reclamacoes(.:format) reclamacoes#index
POST /reclamacoes(.:format) reclamacoes#create
new_reclamaco GET /reclamacoes/new(.:format) reclamacoes#new
edit_reclamaco GET /reclamacoes/:id/edit(.:format) reclamacoes#edit
reclamaco GET /reclamacoes/:id(.:format) reclamacoes#show
PATCH /reclamacoes/:id(.:format) reclamacoes#update
PUT /reclamacoes/:id(.:format) reclamacoes#update
DELETE /reclamacoes/:id(.:format) reclamacoes#destroy
What is wrong?