Why helper devise_controller? returns false for the following code:
class ApplicationController < ActionController::Base protect_from_forgery with: :exception layout :resource protected def resource if devise_controller? #"admin" puts "admin" else #"application" puts "app" end end end while in the browser line, go to " http://127.0.0.1ل000 / admin / review "
routes.rb file:
Rails.application.routes.draw do get 'admin/show' get 'admin/upload' get 'admin/review' get 'welcome/index' get 'welcome/portfolio' get 'welcome/about' get 'welcome/contact' get 'welcome/blog' get 'welcome/review' end while for other routes get 'admin / show'and get' admin / upload 'the helper returns true ....
Update
In general, the problem was solved like this. Added a filter to ApplicationController
before_filter :my_filter, unless: :devise_controller? def my_filter if params['controller'] == 'admin' render layout: "admin" end end But the question essentially remains - why does the same malfunction work through the layout ?