Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I started using rails_admin engine lately and can't quite figure out how I can add my own pages to it. My requirement exactly is that I have a controller and view that fetches all the available mongoDb collections and displays at

http://localhost:3000/mongo/collections

Is it possible to merge this view somehow with rails admin so that I get a link as

http://localhost:3000/admin/mongo

I am not using ActiveRecords or models. I'm fetching the data from HTTP request and displaying it. Ideally, I need a tab for my page just below the default dashboard tab. Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
833 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you want to display this as a tab, take a look at RailsAdmin's new custom actions.

I just gave some examples and links in my answer to this question.


If you don't want to add this functionality as a custom action, you can:

  • Map a route to your controller & action
  • Have your controller inherit from RailsAdmin MainController and write code for your action
  • Include a view for your action
  • Copy a RailsAdmin view over to add it in as a tab

However, I'd recommend the custom action approach because it does not require you to keep your copied RailsAdmin view updated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...