Permalink
Browse files

Merge branch 'master' of github.com:sferik/rails_admin

  • Loading branch information...
2 parents 2d72aaf + 537af99 commit 1c33507a7f47ac1af7ea06a9a26181adf7c31db5 @bbenezech bbenezech committed Oct 2, 2012
Showing with 11 additions and 9 deletions.
  1. +5 −4 README.md
  2. +4 −3 lib/generators/rails_admin/install_generator.rb
  3. +1 −1 lib/rails_admin/version.rb
  4. +1 −1 spec/dummy_app/config/routes.rb
View
@@ -1,8 +1,9 @@
-# RailsAdmin [![Build Status](https://secure.travis-ci.org/sferik/rails_admin.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/sferik/rails_admin.png?travis)][gemnasium] [![Click here to lend your support to: RailsAdmin and make a donation at www.pledgie.com !](https://www.pledgie.com/campaigns/15917.png)][pledgie]
+# RailsAdmin [![Build Status](https://secure.travis-ci.org/sferik/rails_admin.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/sferik/rails_admin.png?travis)][gemnasium] [![Code Climate](https://codeclimate.com/badge.png)][codeclimate] [![Click here to lend your support to: RailsAdmin and make a donation at www.pledgie.com !](https://www.pledgie.com/campaigns/15917.png)][pledgie]
RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.
[travis]: http://travis-ci.org/sferik/rails_admin
[gemnasium]: https://gemnasium.com/sferik/rails_admin
+[codeclimate]: https://codeclimate.com/github/sferik/rails_admin
[pledgie]: http://www.pledgie.com/campaigns/15917
It started as a port of [MerbAdmin][merb-admin] to Rails 3 and was implemented
@@ -83,19 +84,19 @@ It will modify your `config/routes.rb`, adding:
mount RailsAdmin::Engine => '/admin', :as => 'rails_admin' # Feel free to change '/admin' to any namespace you need.
```
-Note: Your RailsAdmin namespace cannot match your Devise model name, or you will get an infinite redirect error.
+Note: The `devise_for` route must be placed before the mounted engine. The following will generate infinite redirects.
The following will generate infinite redirects.
```ruby
mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
devise_for :admins
```
-Consider renaming your RailsAdmin namespace:
+This will resolve the infinite redirect error:
```ruby
-mount RailsAdmin::Engine => '/rails_admin', :as => 'rails_admin'
devise_for :admins
+mount RailsAdmin::Engine => '/rails_admin', :as => 'rails_admin'
```
See [#715](https://github.com/sferik/rails_admin/issues/715) for more details.
@@ -37,6 +37,10 @@ def install
display "Looks like you've already installed it, good!"
end
+ namespace = ask_for("Where do you want to mount rails_admin?", "admin", _namespace)
+ gsub_file "config/routes.rb", /mount RailsAdmin::Engine => \'\/.+\', :as => \'rails_admin\'/, ''
+ route("mount RailsAdmin::Engine => '/#{namespace}', :as => 'rails_admin'")
+
unless routes.index("devise_for")
model_name = ask_for("What would you like the user model to be called?", "user", _model_name)
display "Now setting up devise with user model name '#{model_name}':"
@@ -75,9 +79,6 @@ def install
end
display "Adding a migration..."
migration_template 'migration.rb', 'db/migrate/create_rails_admin_histories_table.rb' rescue display $!.message
- namespace = ask_for("Where do you want to mount rails_admin?", "admin", _namespace)
- gsub_file "config/routes.rb", /mount RailsAdmin::Engine => \'\/.+\', :as => \'rails_admin\'/, ''
- route("mount RailsAdmin::Engine => '/#{namespace}', :as => 'rails_admin'")
display "Job's done: migrate, start your server and visit '/#{namespace}'!", :blue
end
end
@@ -2,7 +2,7 @@ module RailsAdmin
class Version
MAJOR = 0 unless defined? MAJOR
MINOR = 1 unless defined? MINOR
- PATCH = 0 unless defined? PATCH
+ PATCH = 1 unless defined? PATCH
PRE = nil unless defined? PRE
class << self
@@ -2,8 +2,8 @@
# Needed for :show_in_app tests
resources :players, :only => [:show]
- mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
devise_for :users
+ mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
root :to => "rails_admin::Main#dashboard"
# https://github.com/sferik/rails_admin/issues/362
match ':controller(/:action(/:id(.:format)))'

0 comments on commit 1c33507

Please sign in to comment.