Forum: Ruby on Rails HELP: NoMethodError (undefined method `stringify_keys!' for

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.
Tom (Guest)
on 2006-01-21 15:13
We have a flash developer who is intergating with a rails application
when
he posts a particular variable (in this case 'rating') We get a 'Rails
Application
Error' Trawling the production log turns up this error;

NoMethodError (undefined method `stringify_keys!' for "10":String):

The html wireframe has no such problem. A select box is used to submit
the data
in the style of.

rating[rating]

Here is the 'def' in the controller;

 def rate
  	dream = User.find(params[:id])
  	rating = Rating.new(params[:rating])

  	# Create or Update rating cookie
  	if !cookies[:rating]
  	  cookies[:rating] = { :value => User.sha1(@request.remote_ip +
Time.now.to_s), :expires => Time.now + 31449600}
  	else
  	  cookies[:rating] = { :value => cookies[:rating], :expires =>
Time.now + 31449600}
  	end
  	rating.cookie = cookies[:rating]
  	dream.ratings << rating
    if dream.update
      flash[:notice] = 'Rating was added to this dream.'
      redirect_to :action => 'show', :id => dream
    else
      render :action => 'show'
    end
  end

Is there something wrong with submiting a post variable called 'rating'
in this way is there another method that im missing?

Thanks in advance.

T
Kevin O. (Guest)
on 2006-01-21 16:33
Tom wrote:
> We have a flash developer who is intergating with a rails application
> when
> he posts a particular variable (in this case 'rating') We get a 'Rails
> Application
> Error' Trawling the production log turns up this error;
>
> NoMethodError (undefined method `stringify_keys!' for "10":String):
>
> The html wireframe has no such problem. A select box is used to submit
> the data
> in the style of.
>
> rating[rating]
>


Which line is the error on, and what does your param hash look like?
This topic is locked and can not be replied to.