class Object
Public Instance Methods
authenticate()
click to toggle source
# File lib/generators/happy_seed/base/templates/application_controller.rb, line 4 def authenticate unless ENV['HTTP_AUTH_USERNAME'].blank? or ENV['HTTP_AUTH_PASSWORD'].blank? authenticate_or_request_with_http_basic do |username, password| username == ENV['HTTP_AUTH_USERNAME'] && password == ENV['HTTP_AUTH_PASSWORD'] end end end
email_required?()
click to toggle source
# File lib/generators/happy_seed/omniauth/templates/user.rb, line 17 def email_required? @oauth_callback != true end
index()
click to toggle source
# File lib/generators/happy_seed/base/templates/spec/controllers/application_controller_spec.rb, line 10 def index render body: "aok" end
password_required?()
click to toggle source
# File lib/generators/happy_seed/omniauth/templates/user.rb, line 12 def password_required? return false if email.blank? || !email_required? !persisted? || !password.nil? || !password_confirmation.nil? end
show_content( key, title = nil ) { || ... }
click to toggle source
# File lib/generators/happy_seed/simple_cms/templates/application_helper.rb, line 3 def show_content( key, title = nil, &block ) content = SimpleContent.where( key: key ).first if @debug_content content = nil end if content.nil? pos = output_buffer.length yield fragment = output_buffer.slice( pos..-1 ) content = SimpleContent.create( key: key, body: fragment, title: title ) else safe_concat content.body end end