Sir Trevor Rails
A set of Rails Helpers for Sir Trevor JS.
- Rails 3.x
- (Sir Trevor JS)[https://github.com/madebymany/sir-trevor-js]
To grab all of the default block type partials into your application run the following generator command:
rails g sir_trevor:views
This will copy all of the SirTrevor block partials into
Handling image uploads
We don't provide a default image uploader out of the box, because everyone will have different requirements. Until we provide a full example project, have a look at this gist which allows uploads using CarrierWave and Fog (for S3).
Parses the blocks JSON content, loops through each piece of block content and render the appropriate partial for the block.
Returns the first available SirTrevor image from the supplied JSON.
Returns an image tag from a SirTrevor Image block
Get the first instance of a specified SirTrevor block type from the supplied JSON
- Add tests
Sir Trevor Rails is released under the MIT Licence