10 essential and useful Ruby on Rails 4 Gems

Source: Internet
Author: User

10 essential and useful Ruby on Rails 4 Gems

 

The Ruby on Rails framework is a powerful tool used to develop Web applications. It is equipped with a large number of built-in functions to help accelerate the development of your Web applications, such as smart routing and Object-link mappers, all adopt the MVC mode.

Rails is designed to use Ruby gem and can be easily expanded. This creates a huge Ruby gem ecosystem that can be used to expand your applications, and even accelerates your development by reducing the time required to develop common functions. We will review some of the gem which we think is very useful below.

Devise

Devise is the most common Gem when using Ruby on Rails,

Devise provides an easy-to-use user authentication solution for Rails programs. You can use this Gem to Implement User Login, registration, password retrieval, account locking, and other account-related functions.

Pundit

It is important to know the differences between authentication and authorization. Devise may help you verify the identity of a user to ensure that the user can perform an action to access a resource. Pundit provides a simpler and less "magic" permission management solution by using Ruby class-defined authorization systems.

Slim

There are many template systems. Ruby on Rails uses the eRuby template system by default, but users usually choose another template system instead. Slim is usually used because it allows you to maintain easy-to-read templates. With its simple syntax, it can be maintained quickly with less Compilation Time.

Draper

Draper allows you to create decorators on your module. It makes your view clearer and avoids coding helpers. You don't need to use a module to call helpers. You only need to define a decorator, which encapsulates the original module and provides some extension methods and attributes for your object.

Cells

You will often reuse many components of an application. Typically, you must determine that your controller calls the same behavior. Cells allows you to obtain some controllers and encapsulate them into the small controllers they own. This makes your code more concise and avoids the long-term helper/partial/filter mes.

FriendlyId

Typically, resource URLs are identified by primary keys, which are usually their database IDs. However, this may cause unfriendly reading. FriendlyId can easily convert your URL to make it more friendly and easier to remember. In this way, your code is rarely changed in your web application.

Simple Form

Form is the core element of each web application. if there is any interaction with the user, a typical approach is to use web forms. simple Form helps simplify this Simple but repetitive work. by using DSL to create forms in a simple and easy way, you can spend less time writing form HTML and more time processing the core business logic of the application.

Paperclip

File Attachments are not easy to process. they usually need to do a lot of work to achieve, or even spend more time to ensure, in a very safe way to achieve. paperclip handles all these processes in your Rails application and expands many things, such as converting images to thumbnails.

Kaminari

Kaminari is not a descriptive name for a Gem, but it is one of the most popular Gem, with about 5 million downloads. it converts any content from ActiveRecord relations into a simple array by using concise, easy, and range-based APIs. the API is transparent to the ORM or template engine.

Sidekiq

There are many options for background processing tools when using Ruby on Rails, but Sidekiq is the most popular one. the reason for its popularity lies in its simplicity of API, and its scale is better than other tools.

10 Essential & Useful Ruby on Rails 4 Gems

By http://www.oschina.net/translate/10-essential-useful-ruby-on-rails-4-gems

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.