TrestleAdmin / trestle

A modern, responsive admin framework for Ruby on Rails
https://trestle.io
GNU Lesser General Public License v3.0
1.97k stars 177 forks source link

ActionView::Template::Error (No route matches {:action=>"new", :controller=>"auth/administrators_admin/admin"}): #400

Open siba2893 opened 2 years ago

siba2893 commented 2 years ago

I just installed Trestle-auth and did the simple install without defining any model (defaulting to administrator), but whenever I log in it simply throws me to an error page.

My project is a rails 7 api only.

But I had installed the trestle gem and trestle-auth showing the login on the "/admin" route.

maszuDEV commented 2 years ago

Hi @siba2893 , try to add in routes:

Trestle::Engine.routes.draw do
    resources :administrators, only: :new, module: "auth/administrators_admin", controller: "admin"
end
siba2893 commented 2 years ago

Hi @maszuDEV I solved it actually it was related to the config.api_only = true that I had on my app. when I turned that off it started working properly.

maszuDEV commented 2 years ago

Hi @maszuDEV I solved it actually it was related to the config.api_only = true that I had on my app. when I turned that off it started working properly

@siba2893 so you resign from API only mode? I understood from your description that you cared about it.

siba2893 commented 2 years ago

Well because I created the app as API Only at the very beginning the project doesn't have anything related to it, so i got no problem with that, just need to add the config to prevent the generators from creating helpers or views.