Ladislav Slezak wrote:
I have finally solved the problem, now we have HTML and Label modules in web-client/webclient/app/helpers/view_helpers subdirectory.
Example (display localized "Delete" string):
<% require 'view_helpers/label' %> <%= Label.delete %>
Sorry, I have found out that my implementation was wrong, rails use a different way to include additional helpers: - create module <Name>Helper in <name>_helper.rb file in app/helpers subdirectory - add "helper :<name>" statement to the _controller_ method which renders the view - use the functions from the <Name>Helper module directly in the .erb template I have changed the helpers to match the expected format. Example usage: Using label_delete function from app/helpers/view_helpers/label_helper.rb file in a view. Controller: -------------------------8<------------------------------- class MyController < ApplicationController before_filter :login_required layout 'main' helper 'view_helpers/label' -------------------------8<------------------------------- (See http://api.rubyonrails.org/classes/ActionController/Helpers/ClassMethods.htm... for more details about 'helper' statement.) View: -------------------------8<------------------------------- <%= label_delete %> -------------------------8<------------------------------- Note: Because functions are included from helper modules you don't have to explicitly write the module names (namespaces). On the other hand this can potentially lead to name collisions when we put a lot of modules/functions there, so I suggest to use the module name as a function prefix. E.g. all functions in LabelHelper module will have prefix label_*, like label_delete in the above example. -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org