If I had this error, I'd guess that I don't have the attribute "body"
in my "responses" table. Though, I don't know the particulars of your
setup, so it could be many things.
However, please note that scaffolding is not the preferred way to learn
Rails. And, secondly, there is a rails dedicated group that is probably
a better place for rails questions.
the "list" action seems to work well, but all other actions result in
errors.
class ResponsesController < ApplicationController
def index
list
render :action => 'list'
end
def list @response_pages, @responses = paginate :responses, :per_page => 10
end
def show @response = Response.find(params[:id])
end
def new @response = Response.new
end
Hi,
My guess is that "response" is something special in Rails (so is "request"
if I remember correctly). You are probably overwriting a Rails instance
variable... Try renaming @response to something else. It might even be your
"Response" model that's confusing Rails: maybe there is a Response class in
Rails. Try renaming it to something else...
Shouldn't you also be inheriting from ActionController and not ApplicationController? Have a look at the ActionController class (http://rubyonrails.org/api/classes/ActionController/Base.html\). I've always thought that ApplicationController was a top-level abstract?
Thanks,
Jeff
(Oh, hi! I don't post much, but I enjoy reading what everyone else does =)
···
On Feb 26, 2006, at 11:21 AM, Guillaume Benny wrote:
the "list" action seems to work well, but all other actions result in
errors.
class ResponsesController < ApplicationController
def index
list
render :action => 'list'
end
def list @response_pages, @responses = paginate :responses, :per_page => 10
end
def show @response = Response.find(params[:id])
end
def new @response = Response.new
end
Hi,
My guess is that "response" is something special in Rails (so is "request"
if I remember correctly). You are probably overwriting a Rails instance
variable... Try renaming @response to something else. It might even be your
"Response" model that's confusing Rails: maybe there is a Response class in
Rails. Try renaming it to something else...
This was the problem. I renamed my controller and things started working as they were designed.
Thankyou,
na
Guillaume Benny wrote:
···
the "list" action seems to work well, but all other actions result in
errors.
class ResponsesController < ApplicationController
def index
list
render :action => 'list'
end
def list @response_pages, @responses = paginate :responses, :per_page => 10
end
def show @response = Response.find(params[:id])
end
def new @response = Response.new
end
Hi,
My guess is that "response" is something special in Rails (so is "request"
if I remember correctly). You are probably overwriting a Rails instance
variable... Try renaming @response to something else. It might even be your
"Response" model that's confusing Rails: maybe there is a Response class in
Rails. Try renaming it to something else...