app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def aut
    if session[:user_id].blank? 
      if not params[:user].blank?
        user = User.find(params[:user]['username'])
        session[:user_id] = user.id 
      else
        respond_to do |format|
          format.html { redirect_to '/login' }
        end
      end
    end
  end
def aut if session [ :user_id ] . blank? if not params [ :user ] . blank? user = User . find ( params [ :user ] [ 'username' ] ) session [ :user_id ] = user . id else respond_to do | format | format . html { redirect_to '/login' } end end end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .