Displaying 1 result from an estimated 1 matches for "indexhelper".
2012 Nov 06
1
Understanding the Rails /lib/ Directory
...world.rb file has the following code:
module HelloWorld
def hello
@howdy = "Hello World!"
end
end
I want to be able to display the results of this method on a View
called index.html.erb, so I include the following code in the
index_helper.rb file:
module IndexHelper
require ''HelloWorld''
end
Also, I include the following code on the view index.html.erb:
<%= @howdy %>
I''ve read where I need to include the following line in the /config/
application.rb file:
config.autoload_paths += %W(#{config.root}/lib
Howe...