PhrasingPlus is a Phrasing extension image inline editing. PhrasingPlus has a hard dependency on Phrasing version 4.0.0rc5, so please go through it's Readme before installing PhrasingPlus. PhrasingPlus is still in Experimental Alpha.
gem 'phrasing_plus'
rails g phrasing_plus
rake db:migrate
//= require phrasing_plus
*= require phrasing_plus
PhrasingPlus can change images in two ways - simple image tags and background images.
Just use it's helpers:
phrasing_image_tag(key, options = {})
The options are used to modify attributes of the image tag such as CSS classes, IDs and similar. To add some attributes to the wrapping span, just pass a wrapper_html
key.
Example usage:
phrasing_image_tag('my-image', wrapper_html: { class: 'my-image-wrapper' }, size: '160x160')
phrasing_background_image_tag(key, options = {}, &block)
The background image tag can be a div (by default) or a span. Pass in options to modify attributes and pass in a block of content that will be rendered inside the div.
Example usage:
<% = phrasing_background_image_tag('my-placeholder', tag: :span) do %>
<p> Hello, this inside my div with a changable background image </p>
<% end %>
By default, PhrasingPlus will store data to your local filesystem. If you want to store them on let's say S3, do the following:
- Add 'fog' gem to your Gemfile
- Create an initializer and add
PhrasingPlus.storage = :fog
- Configure Carrierwave to work with s3. Follow this link for Carrierwave 0.10.0 (or switch tag version if you're using another version of Carrierwave).
This project rocks and uses MIT-LICENSE.