Project

General

Profile

Actions

Defect #11151

closed

Functions from helper modules for plugin not accessible

Added by Vitaly Klimov over 12 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

It seems that files under plugins/plugin_name/helpers ignored by Rails completely.

To check this, just create some SettingsHelper module in file names settings_helper.rb in some plugin folder:

module SettingsHelper
  def get_text
    "Plugin description" 
  end
end

Next, create file in app/views/settings/ named _some_plugin_settings.html.erb with following content:

<fieldset class="box tabular">
  <p>
    <%= get_text %>
  </p>
</fieldset>

Then add settings property to plugin init.rb file:

settings(:partial => 'settings/some_plugin_settings')

Now, when you try to configure plugin you will get undefined method (get_text) error.

Actions

Also available in: Atom PDF