README.md in hydra-editor-1.0.0.beta1 vs README.md in hydra-editor-1.0.0.beta2

- old
+ new

@@ -37,13 +37,21 @@ PdfModel: "PDF" RecordedAudio: "audio" ``` -Expects the following interface on your hydra models: +Create a form object for each of your models. -```terms_for_editing``` returns an array of model attributes to edit +```ruby +# app/forms/recorded_audio_form.rb +class RecordedAudioForm + include HydraEditor::Form + self.model_class = RecordedAudio + self.terms = [] # Terms to be edited + self.required_fields = [] # Required fields +end +``` Add the javascript by adding this line to your app/assets/javascript/application.js: ```javascript //= require hydra-editor/hydra-editor @@ -52,9 +60,11 @@ Add the stylesheets by adding this line to your app/assets/stylesheets/application.css: ```css *= require hydra-editor/hydra-editor ``` + +(Note: The Javascript includes require Blacklight and must be put after that.) ## Other customizations By default hydra-editor provides a RecordsController with :new, :create, :edit, and :update actions implemented in the included RecordsControllerBehavior module, and a RecordsHelper module with methods implemented in RecordsHelperBehavior. If you are mounting the engine and using its routes, you can override the controller behaviors by creating your own RecordsController: