Must know Ruby on Rails + Ruby plugins - ruby-on-rails

I'm fairly new in the Ruby + Rails scene. Although I have a very strong understanding of design patterns, data structures and algorithms - there's a ton of "must have" plugins that I haven't had a chance to run into yet. There's things for migrations, resource controllers and a myriad of other plugins that make developing for these platforms significantly easier.
Would anyone be kind enough to share links for some of the most commonly used ones that every savvy Ruby or Ruby on Rails developer knows about. Something that's so important, that it might even be considered to be merged into the core at some point.
Hope that's appropriate for this forum. I surely think it is.

The Ruby Toolbox is another invaluable resource for Ruby and Rails developers

Here is the link for rails top rated plugin.
http://agilewebdevelopment.com/plugins/top_rated

You can find all top rated plugin at github.
Example:-These are some most usable plugins
http://github.com/thoughtbot/paperclip
2.http://github.com/mbleigh/acts-as-taggable-on
3.http://github.com/binarylogic/authlogic

RailsGems.org looks like it will be a useful site.

Related

Good documentation for writing Redmine plugins

I am currently developing some plugins for Redmine, and I must say, I'm a bit disappointed with the lack of documentation available on this subject.
Normally, If I am looking for explanations on classes/methods, I need to spend a consistent amount of time browsing trough the core classes, and striving to understand the code written there (It seems that some people forgot to document their code, unfortunately).
I've checked their forums http://www.redmine.org/projects/redmine/boards, and it seems to take forever in order for a question to be answered.
That's why I would like some advice regarding some good API documentation/books/forums on this subject.
I know this maybe too-late for the original question poster but might help someone else in a similar situation. Below links are for a total newbie (like me) to RubyOnRails but someone who's programmed before. You can pick and choose the relevant ones as per your skill level.
Understanding Redmine (functionality):
If you're not familiar with Redmine or administering other Issue Tracking Software Mastering Redmine book is an ok place to start. It's not very densely packed so it'll help only as a structured organization of information. If you want more dense information go through the documentation instead.
Understanding Redmine Plugins:
"Redmine Plugin Extension and Development" by Alex Bevilacqua has just been released (March 2014). It's available both in print and ebook formats from packtpub.
I'm going through the book myself as I need to customize/rewrite a plugin for Redmine.
I'm new to Rails/Ruby/Redmine myself. Though I'm from Unix/C++ background still getting to know the ropes of Ruby, Rails, Redmine via following books.
Understanding Rails:
I found the book Agile Web Development with Rails to be a good enough intro to Rails for programmers from other languages.
Note: Target audience seems to be Rails developers but it should be possible to get through that learning curve by browsing github redmine plugin repositories.
Understanding Ruby:
Programming Ruby (the PickAxe Book)
Understanding Ruby Metaprogramming idioms (used in Rails):
On the surface Ruby looks like most scripting languages it is the use of MetaProgramming and Dynamic nature of Ruby Object Model that allows making complex internal gymnastics invisible to newbies.
A single line of Rails code contains enough such tricks to fill a small book.
Fortunately such a book has already been written - Ruby MetaProgramming book in Pragmatic Programmers series. It's superb to come to grips with this Mixin based Dynamic MetaProgramming. Rails and Redmine use plenty of these tricks as hooks etc to get the work done.
Excellent Video on Ruby Object Model by Dave Thomas
Video on Ruby Object Model and Meta Programming
the better documentation is the codesource. One the Redmine's mainteners have almost all Redmine's plugin on github.
you can choose any plugin and see what is looks like. mostly it's about metaprogramming and alias_method_in_chain usage
As stated on the redmine wiki page about plugin hooks:
There is a list of valid hooks. But the best way to find them is to just have a look into the code to find the place you would like to extend and search for a call to a hook nearby.
It seems browsing through the core classes as well as looking at other plugins is the way to go.
I assume you already found all the documentation on the wiki related to plugins:
The plugin tutorial
The plugin internals page
The above mentioned page explaining hooks
And finally, the list of the currently available hooks (rake redmine:plugins:hook_list in order to get the latest list of the installed redmine version)
As to the reactivity on the forum, you may try asking a question on the forum of chiliproject, the recent fork of redmine. Not sure though how much of it has already changed.

How to make a pluggable rails app

Basically, I would like to write a rails 3 app that
is embeddable in other rails 3 apps (basically some routes, a controller, and some views, no persisting models)
works standalone
can be bundled up into a gem and be launched from a command (this one is more a nice to have)
From what I have read, rails engines would totally solve my problem. The vast majority of what you get when you google it is either people complaining about a lack of documentation, or someone building a plugin, not really a pluggable app. Could anyone point me to better documentation/screencasts (even books if nessicary)
Thanks a bunch
Matt, I'm working on a rails forum engine and I had to figure a lot of this out so I extracted the foundation into a detailed example that covers a lot of common needs. It's generalized so you can easily adapt it. I don't have detailed documentation yet but I link to the sources that I used to figure this out, and I'm happy to answer questions about my source. Check it out:
http://keithschacht.com/creating-a-rails-3-engine-plugin-gem/
An Engine is really what you need and totally designed to meet your reuirements.
Engines actually work a lot better in Rails3.
A lot of the complaints from previous versions of Rails have been resolved in the latest version. I have used engines quite extensively in Rails 2.x and not found them to be all that bad to be honest.

Helping Rails Newbies identify version-specific information on web pages

I am trying to help some people getting started programming on rails identify which version that advice found on web pages corresponds to, and am seeking advice and/or guides on how to do it so they don't have to rely on me and/or waste time trying outdated advice.
Narrative: I am helping some people get up to speed on rails development, and their stock response to running into problems is searching google for advice. They're using 2.3.5 and thinking of moving to 3. The problem they're running into is that there's a lot of advice out there specific to older rails versions (2.2 for example being popular) that isn't identified.
I can usually figure out when the pages are old pretty easily, but they can't (yet.) It seems like random web page authors don't identify which version they're using when they're using the current version, and not all pages are dated.
This seems to be a general problem that will get worse -- current unadorned advice is usually 2.3.5 and older unadorned advice is 2.2.x at this point, but people are moving / will be moving to version 3 over the next while and newbies will be stuck looking at a bunch of deprecated/incompatible 2.3.x advice without realizing which version it is.
Any advice / pointers / telltales?
Check out API Dock. It has an excellent, annotated, and more importantly, versioned documentation of the rails API.
When I started with Rails 2.x last year, I got some books that were talking on Rails 1.x
There were things that changed from 1.x to 2.x, such as the way scaffolding works or that a framework like streamlined stopped from existence. On the other hand, there were some concepts and points that stayed valid from Rails 1.x to 2.x For example, most tutorials and documents start on talking about the model layer, how easy it is to use ActiveRecord and how you have REST for dealing with basic CRUD operations.
In general, I think with such an active community, it's actually one of the strong point of rails that you get so many shifts in innovation so fast. Actually, it is one of the strong points of the open-source community.

What can I expect as the core stack for Rails 3.0 and what will I need to include now as a plugin

So Rails and Merb are sort of merging in Rails 3.0? Thats how its been described to me anyway. This means that a lot of what made Rails, Rails will now be moved to plug-ins so that it can be more lightweight. HOwever, what are those plug-ins going to be and as a new Rails developer, what are THE must have - and also more mature - plug-ins that a Rails developer should install? Some good examples I can think of might be will_paginate, ruby_prof or sqlite3-ruby.
My understanding is that Rails (3) will still essentially be composed of the framework components that make it up now i.e. ActiveRecord, ActiveSupport, ActionPack, even prototype.js etc. It's just that the internals have been significantly refactored and cleaned up and it will be much easier to swap out components for alternatives. For example, perhaps replacing ActiveRecord with Data Mapper.
The tag line for Rails 3 is the same as Burger King i.e. Have It Your Way (I'm not joking!)
Many releases have taken out significant components and put them in plugins, you probably haven't even noticed most of the time. The best thing to do would be to just stay upgraded and pay attention to deprecation messages in your logs and you'll be fine.
This is all thanks to posts like this which highlighted the problems to the community earlier on. Now it should be much, much smoother.

Are there any potential disadvantages in using a Ruby framework other than Rails?

I would like to use a lighter framework than Rails (Sinatra/Ramaze/Camping) but am concerned that by doing so I will not be able to use a lot of shared libraries that have been tailored to Rails in the form of plugins. Is this a major concern or are most of these plugins usable across different Ruby frameworks?
Are there any other potential disadvantages in using a Ruby framework other than Rails?
You can still use gems in all of the frameworks you mentioned, so a ton of stuff is reusable. Want to swap in a new ORM, no problems. Want a fancy shmacy syntax highlighting, no problems. Rails has been making a huge push to move away from the old plugin model to use gems exclusively.
If one of the other frameworks fits your needs better use it. Keep in mind that when it comes to documentation and samples rails has more.
If I was learning Ruby and wanted to try out a web framework I would probably go with Rails not because its better, but because its got much better tooling and documentation.
Most Ruby modules used by Rails (even ActiveRecord) can be used without Rails. But then you lose the extra benefit of integration provided by Rails. You may have to work extra hard to glue Ruby modules to the framework of your choice. Please also note that most of the documentation about Ruby modules used by Rails tells you only how to use that module with Rails.
Network effects play a bit of a role.
One issue that comes up when you use other frameworks like sinatra, camping, etc is that rails gives you a proven structure for your files in the your application. Smaller frameworks are quite open and free.
This can be a downside when you are working with multiple developers as you need to have conversations about creating conventions rather then simply following them.
If you've been using Ruby for less than a year, stick to Rails, unless you have a very clear need that is better handled by one of the other frameworks.
The lighter frameworks, most notably Sinatra, tend to be popular with people who know exactly what they will need and can't afford to have any additional overhead from unused code. Essentially, you pick your toolchain, instead of generally being stuck with what Rails gives you. (Yes, in Rails, you can replace ActiveRecord, et al. with other libraries, but it's not exactly easy.) So the lighter frameworks give you significantly more freedom, but you also have quite a bit more work to do in many cases.
I think no rails plugin is going to work out of the box with any of the alternative frameworks, except for ActiveRecord plugins (such as acts_as_nested_set etc.) which are still going to need some plumbing work (setting $LOAD_PATH and requiring right files). I'd recommend DataMapper for ORM, not only it's way faster than ActiveRecord, but it's also very modularly built and plugins are actual gems that you can easily install. In difference, ActiveRecord plugins are mostly monkey-patches that tend to break with every new version.
Sinatra doesn't come with any "goodies", no Rakefiles, no skeletons, no script/generate, but actually that's what it's been written for. You can gradually "plumb in" all the extra stuff. There are also skeletons for sinatra apps that come with some basic layout and defaults, you may find these useful.

Resources