jeudi 25 juin 2015

rails with devise, How to seperate login view of front and back

I'm try to seperate login view between front and back, I'm create devise user model and admin model inherit user.

../model/user.rb

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :confirmable
end

../model/admin.rb

class Admin < User
end

and I duplicate every view folder in users to admin folder(sessions, users, etc..).

It's work to login page front and back, But before_action :autenticate_(admin or user) are seperate front and back. I can't be used together data after login in front and backend.

So the question is: How to used user data after login between front and backend?

Sorry my english is not good.

Aucun commentaire:

Enregistrer un commentaire