I want to learn how to write a gem that integrates with rails (3) at some level. I'm learning towards something that hooks into activerecord as I would love to learn that, but not sure how advanced that would be.
This is for learning purposes, so would there be a gem that I could read the source that you would recommend?
Something interesting yet approachable for someone trying to learn.
Gems in Rails are libraries that allow any Ruby on Rails developer to add functionalities without writing code. You can also call Ruby on Rails gems as plugins for adding features. A Ruby gem enables adding features without creating the code again and again.
The basic difference is a gem is something that needs to be installed on the system running your Rails application, whereas a plugin is deployed along with your application. More specifically, plugins live in vendor/plugins whereas gems need to be install using rake gem install gem_name.
This guide: The Basics of Creating Rails Plugins should be a good start for you.
If you are using Rails3, I think the gem 'devise' is a good example to learn.
and the basic of creating a gem using bundler, see this post: https://github.com/radar/guides/blob/master/gem-development.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With