Reputation: 633
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.
Upvotes: 2
Views: 2998
Reputation: 2552
make sure you have _index.html.erb
file
views/admin/myname/_index.html.erb
Upvotes: 3