Auto_html表示未提供块

我有一个允许用户发布链接的网站。 我试图让soundcloud链接嵌入媒体文件,因此我试图使用AutoHtml Gem。 我做了gem安装Autohtml,把它放在我的gemfile和config / application.rb中并​​运行bundle install。 为什么Auto_html()不起作用。

GEMFILE source 'https://rubygems.org' gem 'rails', '3.2.8' gem 'bootstrap-sass', '2.0.4' gem 'bcrypt-ruby', '3.0.1' gem 'faker', '1.0.1' gem 'will_paginate', '3.0.3' gem 'bootstrap-will_paginate', '0.0.6' gem 'jquery-rails', '2.0.2' gem 'pg', '0.12.2' gem 'rails_autolink', '~> 1.0.9' gem 'rinku', '~> 1.5.0', :require => 'rails_rinku' gem 'auto_html', '1.6.0' CONFIG/APPLICATION.RB require File.expand_path('../boot', __FILE__) require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "active_resource/railtie" require "sprockets/railtie" require "rails_autolink" require "rails_rinku" require "auto_html" VIEW/MICROPOSTS/_MICROPOST.HTML.ERB    

抱歉我不熟悉Ror我很感激帮助。 我特别想在声音云中使用Auto_html。 我忘了做什么?

它是辅助方法,因此您需要以下几行:

 # app/helpers/application_helper.rb module ApplicationHelper include AutoHtml end # app/controllers/application_controller.rb class ApplicationController < ActionController::Base # or something like that helper ApplicationHelper end 

编辑如果您阅读页面,给出一个示例块: https : //github.com/dejan/auto_html

auto_html(str) { simple_format; link(:target => 'blank')

适用于soundcloud

auto_html(str) { soundcloud }