我完全坚持这个错误.使用Rails 3.1试图实现Formastic Bootstrap gem并获得错误:
`':没有这样的文件要加载 - formtastic/helpers/buttons_helper(LoadError)
Application.css
*= require formtastic
*= require formtastic-bootstrap
Run Code Online (Sandbox Code Playgroud)
的Gemfile
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
gem 'less-rails-bootstrap'
gem 'bootstrap-sass'
end
Run Code Online (Sandbox Code Playgroud)
formastic.rb
Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
gem 'formtastic'
gem 'formtastic-bootstrap'
Run Code Online (Sandbox Code Playgroud)
buttons_helper
module FormtasticBootstrap
module Helpers
module ButtonsHelper
include Formtastic::Helpers::ButtonsHelper
def buttons(*args, &block)
html_options = args.extract_options!
html_options[:class] ||= "actions"
if html_options.has_key?(:name)
ActiveSupport::Deprecation.warn('The :name option is not supported')
end
if block_given?
template.content_tag(:div, html_options) do
yield
end
else
args = [:commit] …Run Code Online (Sandbox Code Playgroud)