views:

528

answers:

1

I am trying to use Datamapper in a Rails app as an alternative to ActiveRecord.

I've followed the various setup instructions and have Datamapper working in my app.

But one of the first things I noticed that no longer works is this:

  <%= f.error_messages %>

I believe this is tied to an ActiveRecord helper - is there an alternative way of reporting validation failures in the View for Datamapper?

Am I likely to encounter many more examples of functionality like this that will require adjustments in my app?

Is this project doable or is it likely to involve a lot of complicated hackery?

Has anyone documented all of the required application adjustments?

I suspect Datamapper is not used widely because I'm finding it hard to find these kinds of simple instructions on Google.

+3  A: 

Today Rails plays well with ActiveRecord; changing ORM will surely give you some troubles. Rails 3.0 will be ORM agnostic so I expect a switch like the one you are describing to be easier in the future.

Unless you are craving to understand Rails inside-out and you are going to have the time to fix the glitches that your application will expose, stick with ActiveRecord.

Am I likely to encounter many more examples of functionality like this that will require adjustments in my app?

It depends on the code you have already wrote. For what you have reported in your question I'd say yes.

Is this project doable or is it likely to involve a lot of complicated hackery?

It is doable and will involve a lot of complicated hackery. The downside is that most of what you are going to learn from this hackery will be likely outdated by Rails 3.0.

Luca