Getting undefined method `stringify_keys!'


#1

This is how my edit.rhtml file looks

Editing environment

<%= start_form_tag :action => ‘update’, :id => @environment.id %>
Pupose: <%= text_field_tag(‘purpose’,@environment.purpose)
%>


Environment: <%=
text_field_tag(‘environment’,@environment.environment) %>


Machine: <%= text_field_tag(‘machine’,@environment.machine)
%>


Application: <%=
text_field_tag(‘application’,@environment.application) %>


OS: <%= text_field_tag(‘os’,@environment.os) %>


PrivateIP: <%=
text_field_tag(‘privateip’,@environment.privateip) %>


<%= submit_tag ‘Edit’ %>
<%= end_form_tag %>

<%= link_to ‘Show’, :action => ‘show’, :id => @environment %> |
<%= link_to ‘Back’, :action => ‘list’ %>

This is how my update controller looks

def update

@environment = Environment.find(params[:id])

if @environment.update_attributes(params[:environment])

  flash[:notice] = 'Environment was successfully updated.'

  redirect_to :action => 'show', :id => @environment

else

  render :action => 'edit'

end

end

When I try to update a record I get following error

NoMethodError in Environment#update

undefined method `stringify_keys!’ for “BSP-2.3.1 Ringback”:String

RAILS_ROOT: script/…/config/…
Application Trace | Framework Trace | Full Trace

./script/…/config/…/vendor/rails/activerecord/lib/active_record/base.rb:1333:in
attributes=' ./script/../config/../vendor/rails/activerecord/lib/active_record/base.rb:1266:inupdate_attributes’
./script/…/config/…/app/controllers/environment_controller.rb:38:in
`update’

./script/…/config/…/vendor/rails/activerecord/lib/active_record/base.rb:1333:in
attributes=' ./script/../config/../vendor/rails/activerecord/lib/active_record/base.rb:1266:inupdate_attributes’
./script/…/config/…/vendor/rails/actionpack/lib/action_controller/base.rb:853:in
perform_action_without_filters' ./script/../config/../vendor/rails/actionpack/lib/action_controller/filters.rb:332:inperform_action_without_benchmark’
./script/…/config/…/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’
./script/…/config/…/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' ./script/../config/../vendor/rails/actionpack/lib/action_controller/rescue.rb:82:inperform_action’
./script/…/config/…/vendor/rails/actionpack/lib/action_controller/base.rb:369:in
process_without_session_management_support' ./script/../config/../vendor/rails/actionpack/lib/action_controller/session_management.rb:116:inprocess’
./script/…/config/…/vendor/rails/railties/lib/dispatcher.rb:38:in
dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:117:inhandle_dispatch’
./script/…/config/…/vendor/rails/railties/lib/webrick_server.rb:83:in
service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in start' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:69:indispatch’
./script/…/config/…/vendor/rails/railties/lib/commands/servers/webrick.rb:59
./script/…/config/…/vendor/rails/activesupport/lib/active_support/dependencies.rb:214:in
`require’
./script/…/config/…/vendor/rails/railties/lib/commands/server.rb:28
./script/server:3

./script/…/config/…/vendor/rails/activerecord/lib/active_record/base.rb:1333:in
attributes=' ./script/../config/../vendor/rails/activerecord/lib/active_record/base.rb:1266:inupdate_attributes’
./script/…/config/…/app/controllers/environment_controller.rb:38:in
update' ./script/../config/../vendor/rails/actionpack/lib/action_controller/base.rb:853:inperform_action_without_filters’
./script/…/config/…/vendor/rails/actionpack/lib/action_controller/filters.rb:332:in
perform_action_without_benchmark' ./script/../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/local/lib/ruby/1.8/benchmark.rb:293:in measure' ./script/../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
./script/…/config/…/vendor/rails/actionpack/lib/action_controller/rescue.rb:82:in
perform_action' ./script/../config/../vendor/rails/actionpack/lib/action_controller/base.rb:369:inprocess_without_session_management_support’
./script/…/config/…/vendor/rails/actionpack/lib/action_controller/session_management.rb:116:in
process' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:38:indispatch’
./script/…/config/…/vendor/rails/railties/lib/webrick_server.rb:117:in
handle_dispatch' ./script/../config/../vendor/rails/railties/lib/webrick_server.rb:83:inservice’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
/usr/local/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:instart’
./script/…/config/…/vendor/rails/railties/lib/webrick_server.rb:69:in
dispatch' ./script/../config/../vendor/rails/railties/lib/commands/servers/webrick.rb:59 ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:214:inrequire’
./script/…/config/…/vendor/rails/railties/lib/commands/server.rb:28
./script/server:3

Request

Parameters: {“machine”=>“qaserver-23”, “purpose”=>“Web-Sujal”,
“commit”=>“Edit”, “os”=>“Solaris 10”, “id”=>“23”,
“application”=>“ringback project”, “environment”=>“BSP-2.3.1 Ringback”,
“privateip”=>“10.112.128.120”}

Show session dump


flash: !map:ActionController::Flash::FlashHash {}

Response
Headers: {“cookie”=>[], “Cache-Control”=>“no-cache”}

I’m new to ruby on rails so any help is appreciated :slight_smile:

Thanks,
Sujal