2011-04-18 61 views
2

我正在使用Rails 3,我已經下載了permalink-fu插件(我已經在Rails 2.3.8中幾次安裝並使用它,沒有任何問題),但是當我去無論對新的或播放模式查看模型(這就是所謂的列表),我收到以下錯誤:Permalink-fu插件在我的Rails 3中不工作

undefined method `evaluate_attribute_method' for #<Class:0xb57ede88> 

,如果我從我的List模型取出has_permalink :title線這不會發生,但我需要它爲了插件工作。

我的模型看起來是這樣的:

class List < ActiveRecord::Base 
    has_permalink :title 

    def to_param 
    permalink 
    end 
end 

我的控制器看起來是這樣的:

def show 
    @list = List.find_by_title(params[:permalink]) 

    respond_to do |format| 
     format.html # show.html.erb 
     format.xml { render :xml => @list } 
    end 
    end 

    # GET /lists/new 
    # GET /lists/new.xml 
    def new 
    @list = List.new 

    respond_to do |format| 
     format.html # new.html.erb 
     format.xml { render :xml => @list } 
    end 
    end 

我的路線文件看起來像這樣:

match '/:permalink' => 'lists#show', :as => :list 

有誰告訴我,什麼是錯的?

回答

2

我已經通過安裝permalink_fu gem而不是插件來完成這項工作。

0

投入到你的Gemfile

gem "permalink_fu", "~> 1.0.0" 

然後

bundle install