Clarify


#1

im learning rails and i got a error while writing a sample code.

Script :

class GuestBookController < ActionController::Base
def index
@entry = GuestBook.find_all
end
def list_parameters
params = request.parameters
render :text=>“Parameters #{params}”
end

def list
params = request.parameters
@entry = GuestBook.new(params[:name])
@entry.save
redirect_to :action => “index”
end
end


i get the error " undefined method `stringify_keys!’ for “name1”:String
"
while the list function is executed

“name1” which i get in the error is the value which i gave for the field
name.


cud u help me to get rid of the error ?


#2

params is an already existing attribute, could give you some
clashes…you might want to rename it…
On Thursday, March 09, 2006, at 2:42 PM, dotnet java developer wrote:

params = request.parameters

cud u help me to get rid of the error ?


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

Mikkel B.

www.strongside.dk - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk - Buy Old Stuff!(DK)


#3

Am Donnerstag, den 09.03.2006, 14:42 +0530 schrieb dotnet java
developer:

 params = request.parameters

cud u help me to get rid of the error ?
The first line of your list method is redundant, because Rails already
provides the request parameter hash in the variable (actual a method)
params. Just drop this line. Maybe this solves it.

You are not saying on wich line the error occurs, but i guess it is line
two @entry = GuestBook.new(params[:name]), isn’t it?


Norman T.

http://blog.inlet-media.de