简体   繁体   中英

issue with mercury rails gem

I was working on a blog app so I want to implemant mercury-rails gem into it, i tried and i got it the tool bar but i was unable to edit any content from my show page

even after everything i am using with the foundation front end framework

<p><span id="page_content class="mercury-region" data-type="editable">
<%=raw  @article.content %></span></p>

<h5><span   data-type="editable"><%= @article.title %></span></h5>

this is my gem file

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails',   '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'zurb-foundation'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

 gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
gem 'simple_form'
gem 'friendly_id'
gem 'devise'
gem "rmagick"
gem "carrierwave"
gem "mercury-rails"

By the looks of things you've followed the old railscast. The mercury-rails projects updates quite frequently.

The problem lies in your attributes on the span tag. You can safely remove the class="mercury-region"

You will also need to change data-type="editable" to data-mercury="full" .

See the different edit types (defined in the data-mercury attribute) on the github page: https://github.com/jejacks0n/mercury#region-types

I hope that helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM