Giter Club home page Giter Club logo

Comments (8)

josevalim avatar josevalim commented on May 16, 2024

Try giving :path_prefix => "admin" instead. It should be almost the same as namespace, but without the adding admin_ to named routes (which wouldn't work anyway).

from devise.

sobrinho avatar sobrinho commented on May 16, 2024

Looking at log:

Processing Admin::SessionsController#new (for 127.0.0.1 at 2009-11-23 19:13:37) [GET]
  Parameters: {"action"=>"new", "controller"=>"admin/sessions"}

ActionController::UnknownAction (ActionController::UnknownAction):
  devise (0.5.5) lib/devise/controllers/helpers.rb:50:in `is_devise_resource?'
  haml (2.2.13) rails/./lib/sass/plugin/rails.rb:19:in `process'
  warden (0.6.4) lib/warden/manager.rb:84:in `call'
  warden (0.6.4) lib/warden/manager.rb:84:in `call'
  warden (0.6.4) lib/warden/manager.rb:83:in `catch'
  warden (0.6.4) lib/warden/manager.rb:83:in `call'

Rendering rescues/layout (not_found)

If i set devise_for outside namespace this works fine

from devise.

sobrinho avatar sobrinho commented on May 16, 2024

@josevalim

i tried but i got the same error:

map.devise_for :users, :path_prefix => 'admin', :controller => 'sessions'
Processing SessionsController#new (for 127.0.0.1 at 2009-11-23 19:18:00) [GET]

ActionController::UnknownAction (ActionController::UnknownAction):
  devise (0.5.5) lib/devise/controllers/helpers.rb:50:in `is_devise_resource?'
  haml (2.2.13) rails/./lib/sass/plugin/rails.rb:19:in `process'
  warden (0.6.4) lib/warden/manager.rb:84:in `call'
  warden (0.6.4) lib/warden/manager.rb:84:in `call'
  warden (0.6.4) lib/warden/manager.rb:83:in `catch'
  warden (0.6.4) lib/warden/manager.rb:83:in `call'

Rendering rescues/layout (not_found)

from devise.

josevalim avatar josevalim commented on May 16, 2024

Just the following should work:

map.devise_for :users, :path_prefix => 'admin'

from devise.

Titinux avatar Titinux commented on May 16, 2024

Hello,

I'm new user of devise and I found the same error as mentionned above.

If in routes.rb I use map.devise_for :admins I can view /admins/sign_in page but if I wrote map.devise_for :admins, :path_prefix => 'bridge' when I go to /bridge/admins/sign_in I encounter the following error :

Processing SessionsController#new (for 127.0.0.1 at 2010-01-14 23:02:13) [GET]

ActionController::UnknownAction (ActionController::UnknownAction):
  devise (0.8.2) lib/devise/controllers/helpers.rb:54:in `is_devise_resource?'
  haml (2.2.17) rails/./lib/sass/plugin/rails.rb:19:in `process'
  warden (0.8.1) lib/warden/manager.rb:34:in `call'
  warden (0.8.1) lib/warden/manager.rb:34:in `call'
  warden (0.8.1) lib/warden/manager.rb:33:in `catch'
  warden (0.8.1) lib/warden/manager.rb:33:in `call'
  passenger (2.2.7) lib/phusion_passenger/rack/request_handler.rb:95:in `process_request'

I'm using rails 2.3.5, haml, devise 0.8.2 et warden 0.8.1

Thanks in advance.

from devise.

josevalim avatar josevalim commented on May 16, 2024

What rake routes shows you? Have you tried :path_prefix => "/bridge" (with "/"), doesn't it work either?

from devise.

Titinux avatar Titinux commented on May 16, 2024

In both case "rake routes" give me the same routes

    new_admin_session GET    /bridge/admins/sign_in                {:action=>"new", :controller=>"sessions"}
        admin_session POST   /bridge/admins/sign_in                {:action=>"create", :controller=>"sessions"}
destroy_admin_session GET    /bridge/admins/sign_out               {:action=>"destroy", :controller=>"sessions"}

But with the '/' that work... but I don't understand why ? I've re-read the documentation and there is no "/" in path_prefix exemples (or I've miss something ?)

Many thanks for the solution.

from devise.

josevalim avatar josevalim commented on May 16, 2024

It should work regardless of the "/", this is a Devise bug.

from devise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.