Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>i have it</p> <p>controllers/admin/sessions_controller.rb</p> <pre><code>class Admin::SessionsController &lt; Devise::SessionsController end </code></pre> <p>controllers/app/sessions_controller.rb</p> <pre><code>class App::SessionsController &lt; Devise::SessionsController end </code></pre> <p>views/admin/sessions/new.html.erb</p> <pre><code>&lt;%= simple_form_for(resource, :as =&gt; resource_name, url: admin_login_path) do |f| %&gt; &lt;div class="form-inputs"&gt; &lt;%= f.input :email, :required =&gt; false, :autofocus =&gt; true %&gt; &lt;%= f.input :password, :required =&gt; false %&gt; &lt;/div&gt; &lt;div class="form-actions"&gt; &lt;%= f.button :submit, "Sign in" %&gt; &lt;/div&gt; &lt;% end %&gt; </code></pre> <p>views/app/sessions/new.html.erb</p> <pre><code>&lt;%= simple_form_for(resource, :as =&gt; resource_name, url: app_login_path) do |f| %&gt; &lt;div class="form-inputs"&gt; &lt;%= f.input :email, :required =&gt; false, :autofocus =&gt; true %&gt; &lt;%= f.input :password, :required =&gt; false %&gt; &lt;/div&gt; &lt;div class="form-actions"&gt; &lt;%= f.button :submit, "Sign in" %&gt; &lt;/div&gt; &lt;% end %&gt; </code></pre> <p>config/routes.rb</p> <pre><code> namespace :app do devise_for :users devise_scope :app_user do get 'login' =&gt; 'sessions#new' post 'login' =&gt; 'sessions#create' end end namespace :admin do devise_for :users devise_scope :admin_user do get 'login' =&gt; 'sessions#new' post 'login' =&gt; 'sessions#create' end end </code></pre> <p>all works fine, also possible add <code>:constraints =&gt; {:host =&gt; "domain"}</code> and edit routes to desired url's</p>
 

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