# coding: utf-8 class FormilyController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception before_filter :set_paper_trail_whodunnit layout :formily_layout protected def authenticate authenticate_or_request_with_http_basic do |username, password| username == 'admin' && password == '123456' end end def formily_layout ApplicationController.new.send(:_layout).virtual_path.split('/').last end end