views:

69

answers:

2

I could use a little help trouble shooting this problem.

When using the app to create a new record nothing is being saved to the database. There are no visible errors presented.

Dropping to the command line, and using the console with the same production environment, I can create a new object and save it (I have to bypass validations). If I look in mysql database I can see the record that I created from the console.

App works fine locally.

Any thoughts on what might be the problem?

Rails 2.0.2

+1  A: 

Sounds like a validation error.

In your controller, try using save! (with the bang) to see if will throw a meaningful error.

I am not sure what code you have in the controller, but this might help show the problem

if my_object.save
  log.debug 'object saved correctly'
else
  log.debug my_object.errors.full_messages
end

Good luck, if this doesn't help. Try posting the relevant controller and model code.

Jonathan
It was a validation error. The model was trying to save a file into a directory that it did not have permission to write to. The write failed and then validation kicked in and everything turned to custard.Thanks!!
Mike Williamson
+1  A: 

Have you double checked that the request (with params, etc) works correctly in development?

If not, perhaps looking at the production log file will tell you where the request was routed (e.g. which controller and action, and with which parameters).

btelles