While creating a search form I am facing a problem. I am getting the following error:
undefined method `model_name' for NilClass:Class
This is my view file:
"datepicker" %>This is my clients_controller.rb:
class ClientsController < ApplicationController
def newClients
end
end
And this is my model client.rb:
class Client < ActiveRecord::Base
# attr_accessible :title, :body
end
I am confused in using form_for
parameter. Can any one explain it briefly how and why to use form_for
parameter?
Edit 1
I have modified my controller as
class ClientsController < ApplicationController
def search
redirect_to root_path
end
end
Once i click submit button it showing error as
No route matches [GET] "/search"