Topic: uninitialized constant ImobsController::Imob Error

Im new programming on Ruby on Rails.
I'm trying to create a very simple form but I'm getting the error uninitialized constant ImobsController::Imob. I've already read other similar topics but I couldn't fix my situation.

Any help is welcome.

imobs_controller.rb

class ImobsController < ApplicationController
  def new
         @imobs=Imob.new
    end

    def create
            @imobs=Imob.new(:params[:tipologia])

      if @imobs.save
        redirect_to new_imobs_path
      end
    end
end


routes.rb

Imobiliaria::Application.routes.draw do
  resources :imobs
root :to => 'home#index'
end


Thanks a lot smile

Last edited by rmonica (2013-01-07 20:11:47)

Re: uninitialized constant ImobsController::Imob Error

1. Where is your new view (probably, new.html.erb file) (in which folder)
2. Could you post the code of the new view?

Re: uninitialized constant ImobsController::Imob Error

My problem is solved. The problem is that I didnt create the model, so I was getting that error.

But anyway thanks for reply smile