KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I just pushed an app to a production Heroku environment. Basically there is a Bus model and it has a seats attribute class Bus < ActiveRecord::Base attr_accessible :seats, # other attributes end Now I have a JavaScript frontend which POST's JSON for new buses to the buses#create action. ActiveRecord keeps encountering an error when I try to create a bus: : POST www.busables.com/buses dyno=web.1 queue=0 wait=5ms service=65ms status=500 bytes=728 : : ActiveRecord::UnknownAttributeError (unknown attribute: seats): : app/controllers/buses_controller.rb:31:in `new' : app/controllers/buses_controller.rb:31:in `create' The parameters are reaching the controller action fine. I can log them and I get the folowing: The bus parameters received: {"seats"=>"24", "departure_time(1i)"=>"2011", "departure_time(2i)"=>"11", "departure_time(3i)"=>"25", "departure_time(4i)"=>"16", "departure_time(5i)"=>"15", "route_attributes"=>{"summary"=>"N51", "beginning_address"=>"A place", "terminal_address"=>"Another place", "distance"=>26362, "duration"=>1753}} I checked that the Bus table actually has the seats column and it does (I ran this in the Heroku console): > Bus.column_names => ["id", "name", "route_id", "created_at", "updated_at", "price", "departure_time", "trip_distance", "trip_duration", "seats"] And of course I've tried migrating and loading the database schema. I've checked that the attr_accessible :seats is set correctly also. Any other ideas? I'm running Rails 3.1.1 on the Heroku Cedar stack. Everything works fine on my local machine.
Tags (comma-separated)
Save Edits
Cancel