简体   繁体   中英

Custom active admin page with index action

I'm using rails 3, I have custom active admin page called "current_details", I have created controller in the admin page:

ActiveAdmin.register_page "Current Details" do

controller do

def index
  @milestones =  Milestone.all
  @collection =  @milestones.select{|a| a.milestone_status == false}
  @current_details = @collection.select{ |a| a.delivery_date.to_date.strftime('%m%Y') == Date.today.strftime('%m%Y') or a.delivery_date.to_date.strftime('%m%Y') < Date.today.strftime('%m%Y') }          
end
end

content only: :index do
   render 'index'
end
end

I need the index action for this, How do I get that?

I already tried with rendering partial, It's throwing error as: Missing partial admin/current_details/index. I referred this
Any help would be appreciable.

确保您有_index.html.erb文件

views/admin/myname/_index.html.erb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM