lib/alchemy/resource.rb in alchemy_cms-2.5.0.b5 vs lib/alchemy/resource.rb in alchemy_cms-2.5.0.b9

- old
+ new

@@ -67,10 +67,26 @@ def engine_name @module_definition and @module_definition['engine_name'] end - protected + # Returns a help text for resource's form + # + # === Example: + # + # de: + # alchemy: + # resource_help_texts: + # my_resource_model_name: + # attribute_name: This is the fancy help text + # + def help_text_for(attribute) + ::I18n.translate!(attribute[:name], :scope => [:alchemy, :resource_help_texts, model_name]) + rescue ::I18n::MissingTranslationData + false + end + + protected def controller_path_array @controller_path.split('/') end