title: NameError in Empresa#new uninitialized constant ActionView::CompiledTemplates::Empresas
body: <p>Error:</p>
  
  <pre><code>SyntaxError
  /root/projeto/config/routes.rb:9: syntax error, unexpected tIDENTIFIER, expecting keyword_end get "/empresa/new" to: 'empresa#new' 
  ^ /root/projeto/config/routes.rb:10: syntax error, unexpected tIDENTIFIER, expecting keyword_end post "/empresas" to: 'empresa#create' ^
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>&lt;%= form_for Empresas.new do |f| %&gt;
    &lt;div class = "form-group"&gt;
      &lt;%= f.label :nome %&gt;
      &lt;%= f.text_field :nome , class: "form-control" %&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;%= f.label :endereco %&gt;
      &lt;%= f.text_field :endereco, class: "form-control" %&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;div class="col-sm-offset-2 col-sm-10"&gt;
        &lt;%= f.submit "Criar", class: "btn btn-primary" %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    class EmpresaController &lt; ApplicationController
      def index
          @empresa = Empresa.order :nome
      end
  
     def new
    @empresa = Empresa.new
  end
  
  def create
    valores = params.require(:empresa).permit :nome, :endereco
    @empresa= Empresa.create  valores
    if @empresa.save
      redirect_to root_url
    else
      render :new
    end
  end
  end
  </code></pre>
  
  <p>Routes:
  Here are the routes of user and company.
  User routes are not called at any time from your company code.</p>
  
  <pre><code>Rails.application.routes.draw do
          post "/usuarios" =&gt; "usuario#create"
          get "/usuario/new" =&gt; "usuario#new"
          delete "/usuario/:id" =&gt; "usuario#destroy", as:  :usuario
          get "/usuario/busca" =&gt; "usuario#busca", as: :busca_usuario
          root to: "usuario#index"
          get "/usuario/lista" =&gt; "usuario#lista"
          get "/empresa/index" =&gt; "empresa#index"
          get "/empresa/new" to: 'empresa#new'
          post "/empresas" to: 'empresa#create'
      end
  </code></pre>