Is there a Rails admin interface that supports MongoDB and Devise? - ruby-on-rails

I recently switched to MongoDB and I am wondering if I can continue using any of the popular admin interface solutions, such as ActiveScaffold and Typus?

You can try Rails Admin:
a Rails engine that provides an easy-to-use interface for managing your data.
Features
CRUD any data with ease
Custom actions
Automatic form validation
Search and filtering
Export data to CSV/JSON/XML
Authentication (via Devise or other)
Authorization (via CanCanCan or Pundit)
User action history (via PaperTrail)
Supported ORMs
ActiveRecord
Mongoid

ActiveAdmin https://github.com/gregbell/active_admin is a great tool for the admin interface creation. And I believe sooner or later they add mongoid support.
Right now there's some patch for it: https://github.com/ebeigarts/mongoid_active_admin_app
I didn't try it myself though.

if your using Mongoid as your ORM, then active_admin should do the job.. apply this patch to get it working
this disables some functionalities (mostly filters because active_admin relies on meta_search and that gem only supports active_record)
Fixes ActiveAdmin sorting
Disables ActiveAdmin Filters/Search
Disables ActiveAdmin Comments

I think you'll find this page on MongoDB's site to be the best help:
http://www.mongodb.org/display/DOCS/Admin+UIs
There are many admin applications available, some in browser, some fat client, etc. that you can use for admin and maintaining your Mongo backend.
I am a .Net programmer so I have used only MongoVUE, but one that caught my eye that I might check out and it should be platform agnostic is JMongoBrowser
I'd bet plenty options will work with a RAILS setup.

Related

Ruby on rails admin actions

I'm learning Rails 4 and I'm looking to build in some basic admin functionality such as creating and viewing users. I can think of a few ways to do it manually, (such as creating a new controller or adding filters) but I'm pretty sure there's a "Rails Way" to do this easily. I've been digging through the docs and I see references to "built in authentication" that support my hunch, but I can't find the actual documentation.
For example, in CakePHP you can just prefix actions with admin_ and /admin/controller/action will work automatically. Is there a similar convention for Rails? If so, where can I find it?
Update:
As I continue to research this, I start to get the impression that admin authorization in Rails is commonly not handled by the Rails core, but rather in a gem like cancan. Perhaps this is why I was striking out by searching the Rails docs.
Update2:
This question wasn't intended to be a round-up of authorization gems, but since it appears gems are the typical way to handle even basic admin authorization, I'd like to find the simplest, most basic (and hopefully universal) option. A couple options have been proposed below which come bundled with default dashboard views and elaborate configurations. I don't need all that. Just a simple, reliable strategy for dividing users into admins and non-admins with different scopes of allowed actions.
Check out the awesome rails_admin gem. It automatically generates just about everything you could need. Very handy and awesome project. https://github.com/sferik/rails_admin
Authentication is handled via the devise gem and authorization via cancan.
It's no replacement for custom admin functionality if you have very specific requirements, but it's great for general admin tasks you described.

Integrating Elasticsearch with Activerecord

In Java when using Hibernate Search for instance you bind JPA insertion, removal and update events to the search engine so that it automatically insert, updates and removes elements from the search engine index at the same time inserting, updating or removing it from the database. Is the same possible in Ruby and when using active record? Or do you manually have to register observers?
There are at least three notable gems allowing you to integrate Elasticsearch with ActiveRecord, some (like elasticsearch-rails, flex, retire) shipping with callback hooks for ActiveRecord that will automatically add, update or destroy an elasticsearch record on the appropriate actions.
elasticsearch-rails: The new default
flex: Really great wiki
stretcher: Runner-up, new option
All of them are actively maintained and developed. A still widely used but no longer maintained gem is retire.
retire: Widely used, but no longer supported
The Tire Rubygem comes with a robust ActiveModel/ActiveRecord integration.
The best option to quickly start is to generate an example Rails application:
rails new searchapp -m https://raw.github.com/karmi/tire/master/examples/rails-application-template.rb
Also, the Railscasts episode gives a quick overview of the integration. Tire README and integration test suite have all the information.

Pattern to model wiki-type functionality

Is there a pattern or a gem (Ruby on rails) for modeling the wiki-like behaviour of a StackOverflow like web site?
I'm working on Ruby-on-Rails project so a gem or something in RoR would be appreciated but a well defined pattern is just as good.
Thanks
Did you try act_as_versioned? It is available as a gem, and adds simple versioning to any ActiveRecord model.
If you need more features, act_as_revisable might be interesting. According to the link, it adds the following features on top of act_as_versioned:
Pervasive Callbacks
Branching and Changesets
Deletes can be stored as a revision
Explicit is better than implicit
All data for a model is stored in one table
Wrapping up, requirements and installing

Are there any authentication plugins that work with DataMapper?

I'm in need of an authentication method that works with DataMapper. I can see that the authlogic plugin requires the fields
crypted_password, password_salt, persistence_token
in the User model. Is it enough to just add these fields to the User model definition using DataMapper?
It would need to be significantly more sophisticated than that, since the APIs are quite different between DataMapper and ActiveRecord. However, it appears at least one person is on the same wavelength as you. Check out this ticket, which has a link to this pastie that integrates authlogic into a User model using DataMapper.
simplest_auth
is compatible with DataMapper

Is there a good admin generator for Ruby on Rails?

My current project is in Rails. Coming from a Symfony (PHP) and Django (Python) background, they both have excellent admin generators. Seems like this is missing in Rails.
For those who aren't familiar with Symfony or Django, they both allow you to specify some metadata around your models to automatically (dynamically) generate an admin interface to do the common CRUD operations. You can create an entire Intranet with only a few commands or lines of code. They have a good appearance and are extensible enough for 99% of your admin needs.
I've looked for something similar for Rails, but all of the projects either have no activity or they died long ago. Is there anything to generate an intranet/admin site for a rails app other than scaffolding?
Active Admin (http://activeadmin.info/) was released in May of 2011, and looks like it's going to become the best Rails 3 option.
rails_admin appears to be the latest-n-greatest free project as of January 2011.
...best of all, there has been a lot of activity in the repository.
Scaffolding is the normal way to create an admin backend BUT there is a project called ActiveScaffold which may solve your problem.
Here is a roundup of a few options, including more than just ActiveScaffold.
ActiveScaffold is available for Rails 2.3.x :)
Just for someonse's info who have found this question one year later like me :)
ActiveScaffold is a good solution, but if you want a more configurable and powerful tool, I think Typus is a great solution:
http://github.com/fesplugas/typus
You have mainly two:
ActiveScaffolding: the most popular but be careful with rails 2.1
Streamlined
ActiveScaffold is by far and away the most configurable/easiest to integrate/most automagic scaffolding around at the moment.
It has built in ajax support, near seamless db introspection and it even plays nicely with legacy Oracle databases (which can be a real pain in Rails).
Try it: http://activescaffold.com/
Have a look at Casein (http://www.caseincms.com/), might be what you're looking for.
Having also tried typus, caseincms and ActiveScaffold over the weekend, I can't rave enough about admin_data.
It is
super-quick to install (Rails 3 is the gem, Rails 2.3 is a plugin branch,
no digging through trees on github),
unintrusive (all code is in the vendor/admin_data folder or the gem where it belongs),
requires no set-up and optional configuration is one block in one file in your app,
correctly (!) gets all model information from your model definitions (primary_key, foreign_key, relationships etc.),
including multiple databases, SQL Server connections via activerecord-sqlserver-adapter, and even composite primary keys, as everything is abstracted on top of ActiveRecord, if you model works, admin_data will work,
works great with legacy data for the above reasons,
uses your existing authentication solution which is called in the most wonderful DRYness in your configuration file.
It maybe less flexible or pretty than other solutions, but this plugin does many thingks right for quick admin panel setup.
The most common way to create a CRUD interface is to use Scaffold.
./script/generate scaffold_resource MyModel property:type property2:type2
This command would generate a CRUD interface for the model named MyModel (singular) with two properties. Properties is what's called columns in DB lingo. So you could have name:string age:integer active:boolean etc.
I can suggest you active_admin that is best
Active Admin main site

Resources