Hello,
I'm trying to create a rails web app that does not use ActiveRecord framework as I have no relational database back end.
So far I managed to create a simple example application that works perfectly for listing, showing and editing my records.
However I'm facing some problems when it comes to the record creation.
The issue is that the controller class does not behave in the same manner if the model class does not inherit from ActiveRecord::Base.
From the controller's point of view, in a classic active record model schema where the model inherits from ActiveRecord::Base, the creation of a record seems to follow this sequence :
- controller.new : creation of a non persistent record, rendering the input form
- controller.create : set up the record with user input, persistant storage , ….
However in the case where the model is not a ActiveRecord we get the following sequence :
- controller.new
- controller.update
Now of course this is a little bit strange because we're skipping the creation method so it will lead to a nil instance error !
I'm pretty certain that this behavior is dictated by something that should be implemented in the model, however I was unable to find what (probably because I'm an absolute beginner with rails )
So if anyone here has some pointers on what I should be looking/implementing in order to solve this situation and have the same behaviour in both cases, I'd be realy grateful.
Thanks,