app/controllers/application_controller.rb
def only_admin!
    if @current_user.nil? or not @current_user.is_admin?
      render_error('Permission denied')
    end
  end
# protect against CSRF, all form CSRF tokens will be managed automatically
protect against CSRF, all form CSRF tokens will be managed automatically
protect against CSRF all form CSRF tokens will be managed automatically
def only_admin!
    if @current_user.nil? or not @current_user.is_admin?
      render_error('Permission denied')
    end
  end
def only_admin! if @current_user . nil? or not @current_user . is_admin? render_error ( 'Permission denied' ) end end
protect against CSRF, all form CSRF tokens will be managed automatically
protect against CSRF all form CSRF tokens will be managed automatically