Forum: Ruby on Rails clarify

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B41155fc4245320d5bd66b38c7dfc7de?d=identicon&s=25 dotnet java developer (Guest)
on 2006-03-09 10:14
(Received via mailing list)
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 ?
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Mikkel Bruun (Guest)
on 2006-03-09 10:35
(Received via mailing list)
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
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
>


Mikkel Bruun

www.strongside.dk    - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk      - Buy Old Stuff!(DK)
Bf66e10c8fc4abefebde0425e7f6f15a?d=identicon&s=25 Norman Timmler (Guest)
on 2006-03-09 10:41
(Received via mailing list)
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 Timmler

http://blog.inlet-media.de
This topic is locked and can not be replied to.