class LanguageCards::Controllers::ApplicationController
Attributes
opts[R]
Public Class Methods
new(opts = {})
click to toggle source
# File lib/language_cards/controllers/application_controller.rb, line 6 def initialize(opts = {}) @opts = opts end
Public Instance Methods
render(_binding)
click to toggle source
# File lib/language_cards/controllers/application_controller.rb, line 10 def render(_binding) view = ERB.new IO.read File.expand_path("../view/#{snake name}.erb", __dir__) view.result(_binding) end
Private Instance Methods
errors()
click to toggle source
# File lib/language_cards/controllers/application_controller.rb, line 22 def errors Array(opts[:errors]) end
name()
click to toggle source
# File lib/language_cards/controllers/application_controller.rb, line 18 def name self.class.name.split('::').last end