This article introduces some of the most popular gems in the Ruby community. The following gems can be found at rubygems.org.
twitter-bootstrap-rails
http://twitter.github.com/bootstrap/
https://rubygems.org/gems/twitter-bootstrap-rails
https://github.com/seyhunak/twitter-bootstrap-rails
Bootstrap, from Twitter, is a complete set of foreground CSS framework. It is famous for its simplicity and elegance. Be favored by countless siege city lion, let countless program ape aesthetic fatigue again.
The Twitter-bootstrap-Rails Gem encapsulates code such as Boostrap CSS
Devise
Used to quickly build user functions, such as: registration, login, personal Settings, password retrieval…
OmniAuth
If you need to implement login support for third-party platforms (Twitter, Facebook, sina weibo, Tencent QQ) in your project, then you need to use it.
RailsCast: Part1 Part2
will_paginate 和 Kaminari
The paging control is used in almost all Rails apps, among which Will_Paginate is older and has more applications, while Kaminari is newer and has better performance and compatibility
Paperclip 和 Carrierwave
Both of these are upload components. Paperclip is an old product and is used by most projects. It can help you with uploading images, trimming and defining different image sizes, almost perfect. CarrierWave, on the other hand, is an upstart. It does almost as much as Paperclip, but it can manage more than just images and is more flexible (Ruby-China uses it). Comparison: Paperclip officially only supports ActiveRecord but is relatively stable, while CarrierWave has the flexibility to support more ORMs, such as MongoID
WiceGrid
Table control, for ActiveRecord, super powerful, support any field sorting, filtering, detailed to see its Demo.
thinking-sphinx
Sphinx based on the full text search component, to do full text search function to use it.
Settingslogic 和 RailsSettings
Projects often have configuration information, and SettingLogic can help you easily use the configuration information written in YAML. RailsSettings is similar, except that it stores configuration information in a database so that it can be changed online at any time. There are also performance issues. You can use a modified version of rails-settings-cached, which caches the configuration.
CanCan
Some apps use the option of setting permissions for different functions for different users. You can try the gem Cancan which can help you plan a good plan. There’s also an explanation for how to use the Railscasts site, which you can check out.
redis-objects
It is a Redis-based data storage plugin for storing data that needs to be stored quickly, such as page views, likes, or lists such as Followers. The data will be stored in Redis and it is very easy to use. It can be combined with the Rails ActiveSupport (in a nutshell, in the Model) to make the data access like a normal field.
Nokogiri
When collecting data, we need to parse the complex HTML structure to obtain the required data. Nokogiri can help us perfectly deal with different HTML structures on different web pages. Besides, it has very good encoding and processing ability. It all works very well, and the parsing structure can be found using CSS selectors like jQuery, which is very convenient. I’ve used several similar plug-ins for Ruby and found that Nokogiri is the best.
Formtastic 和 simple_form
Rails has brought us a radical change in the way forms are built, but we’ve come to realize that this is still not agile enough. We need a simpler and more detailed form, so we have Formtastic, which is much cleaner to use than the Rails default form. You can also set the help-text for each field and place it under the text box. You can also set the language the I18n way. See the introduction to Formtastic on the Railscasts section above. Simple_form is similar to Formtastic, but it’s a little easier to write.
Whenever
Linux has Cron can help us to perform some tasks on a regular basis, but Cron manual writing is very troublesome, especially the previous time period definition, Whenever can help us to write Cron tasks in a more humane way, See the Railscasts section for details about the clean time.
Resque 和 Delayed_job
Sometimes tasks that are slow to perform that we don’t need to return results immediately (such as sending an email, generating a thumbnail image) can be placed in the background so that the page doesn’t wait long to execute. Resque and delayed_job help us get this done very easily. The difference between Resque and Delayed_job is that it can have different queues, whereas Delayed_job has only one, but it can set the priority. In addition to ActiveRecord, Delayed_job also supports other ORMs (see here for details). Delayed_job is easier to use. So, this one really depends on the use scenario, but the Resque description says that if you have a huge number of tasks that need to be queued up and don’t require priority, then you should just use it. DelayedJob is not suitable for handling large numbers of tasks, the bottleneck is database-based, and queues are not supported. Resque is much easier to operate than Resque. Resque is based on Redis, which allows for faster task generation and is much better in performance than a DelayedJob. The only drawback is that it doesn’t support scheduled tasks, but having the resque-scheduler compenses for this. In addition, it has a Web management interface for checking off tasks and tracking mistakes.
rails-dev-boost
As the project grew larger and the files grew larger, we began to find that project execution in a development environment was unbearably slow. This problem because the Rails Development environment no cache all classes (Model, Controller, Helper, Views…). Files are reloaded every time the page is refreshed, and the loading process is actually slow. This is a Ruby performance problem, so Rails-Dev-Boost uses caching to solve this problem. It can increase the speed of large projects by 10 times, but some projects may not work. ActiveAdmin, for example. Using this Gem to speed things up in Rails 3.1 is even more effective because by default the Rails 3.1 development environment requires reloading all application files every time an asset is requested, even for an image.
Cells
When designing Views, we will abstract some of the local functions that are used by many pages into Partials, but we will find it difficult to do this because the data will still need to be loaded in different controllers. Cells can help us solve this problem. It can make a local function, from data call to View generation, into a single component, which can be used in a single line of code without other calls. At the same time, it can also set the cache in the Cell, and granulate the cache. And it’s much more efficient than Partials.
Smurf
Rails 3.1 gives us an Asset Pipeline to handle JavaScript and CSS compression, but what about previous versions of Rails? Smurf works, it’s very simple to use, just install it, you don’t have to change the code. At the same time, you can use another improved version of smurf-huacnlee which can handle the problem of CSS image address, will add a timestamp (similar to image_tag effect), to solve the problem of image update, user browser cache update.
daemon-spawn
Starting something off as a daemon, like Debian’s Service Foo Start, which is used to manage Resque starting and restarting, is really easy.
Grape
With the growing number of Mobile apps, many times when we do API Base projects with Rails, the C and V layers are too much, and Grape helps us quickly build an API interface that is perfectly integrated with Rails.
ClientSideValidations
More and more websites now use JavaScript for client-side validation to improve the user experience. For programmers, it also adds one more job. However, client-side validation logic is almost the same as server-side validation logic. If you need to write another validation code, it is not DRY enough. Client_side_validations is needed to solve this problem. Client_side_validations reads the server-side validation logic and generates the corresponding client-side validation logic (depending on jQuery), allowing you to implement client validation with almost no additional front-end code.
by_star
This is an auxiliary ActiveRecord components, let you can easily achieve by the year, month, day, or a week, to query data, very simple to use, save trouble condition combination, in addition, it also can query the previous, under a similar function.
rolify
A very simple role setting module that does not require authentication and supports resource object scopes.
gon
This gem can be used to pass server data to JS. It’s easy to use.
rest-client
A simple and powerful HTTP/REST client that works perfectly with Grape
pry
Simple and powerful debugging tools, lightweight tools. Direct debugging in the terminal is convenient and direct
Seed Fu
Powerful seed
rails_best_practices
There is always a lot to be said for writing code, and it is better to use this tool to control the quality of your code.
lazy_high_charts
Highcharts is excellent in the current drawing JS library, and Rubyist uses this gem to manage and write the required graphs.
Better Errors
It replaces the standard Rails error page with a better, more useful error page, and works equally well for Rack Middleware. The Railscasts are also described.
god
Ruby process monitoring tools
You can also check out RubyGems ranking site Ruby-Toolbox.com
contributors
via Ruby China Wiki