I’m sure I’m not the first guy asking about this, why doesn’t Rails come with an admin framework by default, something of the sort Django has? This will probably require adding some authentication mechanism to the framework as well, which might as well be Devise since so many Rails apps use it anyway. We’ve added cool stuff to the framework like ActionCable and ActionText and ActionMailbox, which usually start as a pain point solved in BaseCamp and then extracted to the framework. There is usually no discussion on whether these pieces need be added to the framework, it’s just assumed a large chunk of web apps need that. So can admin + auth have this discussion now?
That’s an excellent idea – Devise was just cut free from Plataformatec owing to their merger with a client (!!!). It’s not suffering, although I have had an issue in there for weeks without any reply, no idea if that’s normal or different, or just to be expected in this day and age. Having the most widely used authentication framework become a part of the big tent would be most welcome!
Hmm, interesting. It feels like there are really two conversations here – one about a built-in admin framework, and another about a built-in auth framework. There seem to be a few conversations about the latter, maybe we can talk about auth more in ActiveAuthentication since it has a more obvious title?
So I am trying to figure out if an admin framework is actually needed by looking at rubygems downloads numbers. search | RubyGems.org | your community gem host , activeadmin is the most downloaded solution with almost 9 million downloads, rails_admin has 3+ millions. Sounds like a lot but it’s nothing compared to devise (73+ millions) or factory_girl (48+ millions). So it makes me conclude admin frameworks aren’t rare but also aren’t ubiquitous in rails apps, at least by looking at the numbers. It could be that many projects roll their own admins frameworks - in that case there is a bigger need for this than the numbers show.
To conclude: more feedback is needed from the community to see if this is even needed. So far I don’t see this post getting much attention compared to others.
I do need to build something for admin in almost all the projects I’ve been on, but the mental load of figuring out how to customize a framework to what I need turns me away, especially if there’s a heavy DSL involved.
I enjoy Administrate precisely because its first guideline is “No DSLs (domain-specific languages)”. I previously used RailsAdmin in my app and indeed did end up quitting because of its DSL and limited maintenance. I managed to stick with Administrate and was able to submit contributions when I encountered some limitations. Two developers from Thoughtbot seem to be regularly maintaining the library, usually every week, and they are steadily preparing for a 1.0 release (I personally run our prod app using the master branch, as their release speed is a bit too slow for my liking).
FYI I wrote the same feedback in this other thread.
Personally I don’t think that looking at download numbers, stars etc is necessarily relevant, as Rails has a long history and projects may not stay updated with the needed bug fixes and enhancements. For instance that approach had led me to choose Globalize for my translations, which right now still declares itself as the “de-facto standard library for ActiveRecord model/data translation” but I encountered various issues with it and the maintainers themselves admitted they instead use Mobility for new apps.
I’d argue against an admin framework.
I have used activeScaffold and activeAdmin in the past to build admin frameworks.
My experience is that an admin framework provides essentially two things
- easy integration with authorisation
- rapid/simple interface generation for CRUD
I’d love to see authorisation included in the stack (discussed elsewhere)
I also think you could make a case for adding the interface generation
At the moment, Rails kinda does this with scaffold generation - and of course the whole point of Rails is that it is fairly simple to roll your own in this area.
I’m not entirely convinced that this isn’t better living in the world of gems where different people can take different approaches (active admin vs administrate vs others)
I agree Rails gets you pretty far but for a usable admin framework you still need to take care of a coherent UI, filters, authorization / authentication etc. The more complicated the admin dashboard needs to be, the more taxing it is for newcomers to understand what you did there. That’s exactly the point of Rails I think, to come batteries included.
What is the criteria for being included in Rails, why couldn’t ActionCable be a gem for example? Or why does authorization need to be included and an admin framework not?
I guess my point is that I would suggest Rails goes at this from a slightly lower level
For example, if Rails is providing a coherent UI, then make that a thing. Make it so that it can be used in admin pages, or a simple user-facing shopping order page.
Filters likewise - don’t build filters for an admin panel, build something like filterrific which can be used elsewhere.
Maybe the way new frameworks (like recent newcomer ActionText) are included into Rails needs to be more transparent? I mean, the fact that Basecamp implemented something doesn’t automatically make it a pain point for most web apps. I don’t believe more apps need a text editor than an admin panel but I don’t think anyone even bothered checking. If we can understand better what the rationale is to include new functionality into Rails we can have a more meaningful discussion here. But as it is now it’s pretty difficult. You say that Rails should come up with low level constructs to make it easy for the community to build gems on top (kinda like they did with ActiveJob), but thats really not what’s happened with ActionText which is pure functionality which you can’t really build on top. I’m not expecting a democracy and I get that Rails is omakase, and like it for the most part. But I think Rails needs to reach out to the community more to understand where it can make our lives better. Basing all decisions on Basecamp alone isn’t data-driven at all. @DHH
What about using templates to create your new apps?
One can have a blog template or an e-commerce template.
I guess I should share mine.
this is one i use to get devise set up. template.rb · GitHub
Or using the recently launched templates site RailsBytes. It has a template for ActiveAdmin: https://railsbytes.com/public/templates/zyvsMx
This thread seems to be going in a few different directions. Conversations I’m seeing happen:
- Should Rails have an admin framework at all?
- What are the weaknesses and strengths of the existing admin framework gems?
- How does Rails decide what will be included as a project?
I think this conversation will be easier for newcomers to follow if we do the following things:
- either cut off the last conversation (How does Rails decide what will be included as a project?) or move it to a different thread.
- Clarify how we’re talking about the weaknesses and strengths of existing gems. e.g. if you bring up
Authenticateare you bringing it up as an argument that Rails should Sherlock Authenticate as is, or as a reason that admin frameworks are impossible to do well? Being crisper about why we are bringing in the examples we are bringing in will make this discussion easier to follow.
I will open a new thread for this. let’s keep this conversation about whether Rails needs an admin for now.
I’ll give the short answer on the “what goes on the menu?” and it’s “the chef’s choice”. It’s not an empirical question with an empirical answer. You can read more in the doctrine: Doctrine | Ruby on Rails.
You can hear the broader philosophy expanded in my RailsConf 2015 keynote as well: YouTube. Goes over the prepper’s backpack metaphor and more.