I'm using this code:
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
and I get this error:
undefined method `section'
if I delete 'section' do-end part, then I get error for:
undefined method `table_for'
and so on...
Seems like I cant use any of active admin given methods, maybe I'm mising something? Any gems or something? I installed active admin gem using this setup:
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'activeadmin', github: 'activeadmin'
gem 'devise', github: 'plataformatec/devise'
I'm using rails 5
I managed to transform my code and now it compiles without any errors.
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
I suppose my previously used syntax is old and not supported any more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With