2016-10-06 7 views
2

私はこのコードを使用しています:Railsのアクティブな管理未定義のメソッド

ActiveAdmin.register_page "Dashboard" do 

    section "Recent Posts" do 
     table_for Post.order("id desc").limit(15) do 
      column :id 
      column "Post title", :title do |post| 
       link_to post.title,[:admin,post] 
      end 
      column :category,sortable: :category 
      column :created_at 
     end 
     strong (link_to "Show all posts") 
    end 
end 

を、私はこのエラーを取得:

undefined method `section' 

私は 'セクションに行うエンド部分を削除した場合、その後、私はエラーを取得します以下のために:

undefined method `table_for' 

のように...

が見えます私はアクティブな管理者の任意のメソッドを使用することはできませんのような、多分私は何かをミューティングですか?どんな宝石か何か?私は自分のコードを変換するために管理レール5

答えて

0

を使用してい

gem 'inherited_resources', github: 'activeadmin/inherited_resources' 
gem 'activeadmin', github: 'activeadmin' 
gem 'devise', github: 'plataformatec/devise' 

今ではエラーなしでコンパイルされます。私は、このセットアップを使用して、アクティブな管理の宝石をインストールしました。

ActiveAdmin.register_page "Dashboard" do 
    content :title => proc{ I18n.t("active_admin.dashboard") } do 
    columns do 
     column do 
     panel "Recent Posts" do 
      table_for Post.order("id desc").limit(5) do 
      column :name do |post| 
       link_to post.title, [:admin, post] 
      end 
      column :created_at 
      end 
      strong (link_to "Show All Posts" , :posts) 
     end 
     end 
    end 
    end 
end 

以前使用していた構文が古いものであり、これ以上サポートされないと考えられます。

関連する問題