Skip to content

Commit

Permalink
Merge pull request #51 from terrellt/master
Browse files Browse the repository at this point in the history
Add form information/jQuery UI info to README.
  • Loading branch information
jcoyne committed Dec 31, 2014
2 parents ddfa273 + 5011cd9 commit 6a10e32
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,17 @@ en:

```

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:

Expand All @@ -55,6 +63,9 @@ Add the stylesheets by adding this line to your app/assets/stylesheets/applicati
*= require hydra-editor/hydra-editor
```

(Note: The Javascript includes require Blacklight and jQuery UI and must be put
after those.)

## 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:
Expand Down

0 comments on commit 6a10e32

Please sign in to comment.