Note that there are some explanatory texts on larger screens.

plurals
  1. POGeneral Routing to Active Admin - Rails 3.1
    primarykey
    data
    text
    <p>I'm currently trying to use Active Admin Gem with an existing Rails 3.1 app already configured with devise. This app uses a after_sign_in_path_for method declared in application controller.</p> <p>I followed the steps explained there <a href="https://github.com/gregbell/active_admin" rel="nofollow">https://github.com/gregbell/active_admin</a>, the thing is that when I try to access 0.0.0.0:3000/admin or localist:3000/admin I'm directly redirected to my home path.</p> <p>Here's my route.rb file,</p> <pre><code>Fish::Application.routes.draw do devise_for :admin_users, ActiveAdmin::Devise.config ActiveAdmin.routes(self) get "goodnewslikes/create" get "goodnewslikes/destroy" resources :goodnews match "goodnews/share/:id" =&gt; "Goodnews#share", :as =&gt; "share_goodnews" match "churches/:id/changepicture" =&gt; "Churches#changepicture", :as =&gt; "change_picture_church" resources :churches match "home" =&gt; "Application#home", :as =&gt; "home" match "currenthome" =&gt; "Application#currenthome", :as =&gt; "currenthome" match "globalsearch" =&gt; "Application#globalsearch", :as =&gt; "globalsearch" match "create_commentlike/:comment_id" =&gt; "Commentlikes#create", :as =&gt; "create_commentlike" resources :commentlikes, :only =&gt; [:destroy] match "create_postlike/:post_id" =&gt; "Postlikes#create", :as =&gt; "create_postlike" resources :postlikes, :only =&gt; [:destroy] match "create_goodnewslike/:goodnews_id" =&gt; "Goodnewslikes#create", :as =&gt; "create_goodnewslike" resources :goodnewslikes, :only =&gt; [:destroy] match "create_notifiations/:type/:user_id/:content_id" =&gt; "Notifications#create", :as =&gt; "create_notification" match "notifications/updateList" =&gt; "Notifications#updateList" resources :notifications, :except =&gt; [:edit, :create] resources :comments, :except =&gt; [:new] match "posts/:id/loadpic" =&gt; "Posts#loadpic", :as =&gt; "load_post_pic" match "comments/new/:post_id" =&gt; "Comments#new", :as =&gt; "new_comment" resources :friendships get "friendships/:id/accept" =&gt; "Friendships#accept", :as =&gt; "accept_friendship" get "friendships/:id/block" =&gt; "Friendships#block", :as =&gt; "block_friendship" get "users/searching" =&gt; "Users#searching", :as =&gt; "searching_users" resources :users, :only =&gt; [:index, :show] do match "profils/nouveau" =&gt; "Profils#new", :as =&gt; "new_profil" match "profils/:id/modifier" =&gt; "Profils#edit", :as =&gt; "edit_profil" resources :profils end match "users/search" =&gt; "Users#search", :as =&gt; "search_users" match "posts_of/:user_id" =&gt; "Posts#index", :as =&gt; "posts_of" resources :posts devise_for :users, :path_prefix =&gt; "d" root :to =&gt; "Application#home" match "*path" =&gt; 'application#handle_404' # The priority is based upon order of creation: # first created -&gt; highest priority. # Sample of regular route: # match 'products/:id' =&gt; 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' =&gt; 'catalog#purchase', :as =&gt; :purchase # This route can be invoked with purchase_url(:id =&gt; product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on =&gt; :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to =&gt; 'welcome#index' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id(.:format)))' end </code></pre> <p>Any idea ? I have no idea what's in "ActiveAdmin.routes(self)" so this is why I'm posting...</p> <p>Thanks :-)</p> <p>And here's my rake routes</p> <pre><code> new_admin_user_session GET /admin/login(.:format) {:action=&gt;"new", :controller=&gt;"active_admin/devise/sessions"} admin_user_session POST /admin/login(.:format) {:action=&gt;"create", :controller=&gt;"active_admin/devise/sessions"} destroy_admin_user_session DELETE|GET /admin/logout(.:format) {:action=&gt;"destroy", :controller=&gt;"active_admin/devise/sessions"} admin_user_password POST /admin/password(.:format) {:action=&gt;"create", :controller=&gt;"active_admin/devise/passwords"} new_admin_user_password GET /admin/password/new(.:format) {:action=&gt;"new", :controller=&gt;"active_admin/devise/passwords"} edit_admin_user_password GET /admin/password/edit(.:format) {:action=&gt;"edit", :controller=&gt;"active_admin/devise/passwords"} PUT /admin/password(.:format) {:action=&gt;"update", :controller=&gt;"active_admin/devise/passwords"} admin_dashboard /admin(.:format) {:action=&gt;"index", :controller=&gt;"admin/dashboard"} admin_admin_users GET /admin/admin_users(.:format) {:action=&gt;"index", :controller=&gt;"admin/admin_users"} POST /admin/admin_users(.:format) {:action=&gt;"create", :controller=&gt;"admin/admin_users"} new_admin_admin_user GET /admin/admin_users/new(.:format) {:action=&gt;"new", :controller=&gt;"admin/admin_users"} edit_admin_admin_user GET /admin/admin_users/:id/edit(.:format) {:action=&gt;"edit", :controller=&gt;"admin/admin_users"} admin_admin_user GET /admin/admin_users/:id(.:format) {:action=&gt;"show", :controller=&gt;"admin/admin_users"} PUT /admin/admin_users/:id(.:format) {:action=&gt;"update", :controller=&gt;"admin/admin_users"} DELETE /admin/admin_users/:id(.:format) {:action=&gt;"destroy", :controller=&gt;"admin/admin_users"} </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload