To create a new helper:
- choose a name for the helper file, for instance tags_helper.rb
- create the file in the /app/helpers directory
-
create a module according to the file name. In this case
module TagsHelper end
-
define your helper as method
module TagsHelper def hello_world(name) "hello #{name}" end end
Now you can use the hello_world
helper method in your view.