Tag: 邮政

button_to没有从params hash传递正确的id

button_to未将正确的id传递给line_item。 在下面的日志中,您会看到bike_id从正确的’86’变为不正确的’1’(巧合的是我的user_id)。 任何帮助,将不胜感激。 下面是我的development.log中的错误,然后是我的视图和控制器中的代码。 谢谢。 development.log Started POST “/line_items?bike_id=86” for 127.0.0.1 at 2011-08-01 18:09:52 -0400 DEPRECATION WARNING: Setting filter_parameter_logging in ActionController is deprecated and has no longer effect, please set ‘config.filter_parameters’ in config/application.rb instead. (called from at /Users/willdennis/rails_projects/spinlister/app/controllers/application_controller.rb:8) Processing by LineItemsController#create as HTML Parameters: {“authenticity_token”=>”5GYQqvf7U5awhLrZ9Aw910ETf2kqOk3PI315jkjEfMU=”, “bike_id”=>”86”} [1m[35mCart Load (0.6ms)[0m SELECT “carts”.* FROM “carts” WHERE (“carts”.”id” […]