Hi I have a helper method, which returns a string, where i need to use this on every view.
I am trying to add this method to the ApplicationHelper
my ApplicationController looks like this
class ApplicationController < ActionController::Base
helper :application
end
my ApplicationHelper looks like this
module ApplicationHelper
def ThemeDir
"http://mysite.com/something/something"
end
end
when i try to use this method in the view as
<%= ThemeDir %>
it gives me the following error.
uninitialized constant ActionView::CompiledTemplates::ThemeDir
can someone help me with this please.
In Rails ‘ThemeDir’ treating it as constant .
Make the method name like ‘theme_dir’, and try that .