2013-03-29 27 views
0

在寶石文件fancygrid問題軌

gem 'fancygrid', '2.0.1', :path => 'lib/fgrid' 

複製的源從https://github.com/giniedp/fancygrid到LIB/fgrid

在控制器:

@contacts = current_user.contacts.where(:status => 0).page(params[:page]).per_page(15).search(params[:search]) 
fancygrid_for :contacts, :builder => ContactsGridBuilder, :persist => true do |g|  
    # specify attributes to display 
    # g.attributes :email_id, :name 
    # specify the callback url for ajax loading 
    g.ajax_url = contacts_path 
    # finally call find to query the data 
    g.find do |query| 
    query.where("user_id = ?", current_user.id).order(:name) 
    end 

得到錯誤

ActionView::Template::Error (Missing template fancygrid/fancygrid with {:handlers=>[:erb, :builder, :slim, :arb, :coffee], :formats=>[:html], :locale=>[:en, :en]}. Searched in: 
* "/home/love/rails/odbf11/app/views" 
* "/home/love/.rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.5.1/app/views" 
* "/home/love/.rvm/gems/ruby-1.9.3-p194/gems/kaminari-0.14.1/app/views" 
* "/home/love/.rvm/gems/ruby-1.9.3-p194/gems/devise_invitable-1.1.6/app/views" 
* "/home/love/.rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/app/views" 
* "/home/love/.rvm/gems/ruby-1.9.3-p194/gems/maktoub-0.2.5/app/views" 
* "/home/love/rails/odbf11/lib/fgrid/app/views" 
): 
    28: 
29: <span id="contact_list"> 
30: 
31: <%= fancygrid :contacts %> 
32:  
33:  
34: 
lib/fgrid/lib/fancygrid/view/helper.rb:10:in `fancygrid' 
app/views/contacts/index.html.erb:31:in `_app_views_contacts_index_html_erb__33025325_105720290' 
app/controllers/contacts_controller.rb:27:in `block (2 levels) in index' 
app/controllers/contacts_controller.rb:26:in `index' 
config/initializers/quiet_assets.rb:7:in `call_with_quiet_assets' 

請建議我該怎麼做

回答

0

我已經解決了這個問題,

在寶石文件我需要添加HAML

gem 'haml' 

這解決了問題