Reputation: 3746
I created a gem Helloword
with the command:
bundle gem helloword
I built the gem with the command:
gem build helloword.gemspec
I edited the Gemfile
of my Rails app:
gem 'helloword', '0.1.0', path: '/Users/iloveyou/helloword'
and I installed the gem:
bundle install
I am using the gem in my page like:
<h1><%= hello_word_tag %></h1>
I get the result:
Why did adding my gem to the website not work?
Upvotes: 0
Views: 28
Reputation: 3746
i Fixed: Change:
def hello_word_tag
"Hello Word!!!"
end
to:
def self.hello_word_tag
"Hello Word!!!"
end
and call:
<h1><%= Helloword.hello_word_tag %></h1>
Upvotes: 0