Returns name of current action
# File lib/padrino-responders/helpers/controller_helpers.rb, line 37 def action_name name = request.match.route.instance_variable_get('@name').to_s name.gsub!(/^#{controller_name}_?/, '') name = 'index' if name == '' name end
Returns name of current controller
# File lib/padrino-responders/helpers/controller_helpers.rb, line 47 def controller_name request.match.route.controller.to_s end
Returns translated, human readable name for specified model.
# File lib/padrino-responders/helpers/controller_helpers.rb, line 54 def human_model_name(object) if object.class.respond_to?(:human_name) object.class.human_name else t("models.#{object.class.to_s.underscore}", :default => object.class.to_s.humanize) end end
Shortcut for notifier.say method.
# File lib/padrino-responders/helpers/controller_helpers.rb, line 30 def notify(kind, message, *args, &block) self.class.notifier.say(self, kind, message, *args, &block) end