The 15 best gems for ruby on rails web applications

The 15 best gems for ruby on rails web applications

In this post I will share the technology stack that we use in DevInterface in order to create Ruby on Rails web applications.From my point of view, the gems that I’ll show later in this article represent the best options to develop in an Agile and DRY way and to achieve complex solutions in the shortest time possible.These gems are the “core” of each our...

Read more

Tips: Multiple pagination with will_paginate

Will Paginate is a great and widely used gem for pagination in Ruby on Rails.Sometimes you need to paginate multiple list on the same page.This tip show you how to put a list of paginated products and a list of of paginated services on the same page with will_paginate. The key point is to use a custom param param_name in the view and also in the controllerThe view code is something like this:123# ... # products list here <%= will_paginate @produ...

Read more

Two step signup with Devise

[** UPDATE: 21/01/2013 **]: Thanks to Kevin Triplett now there's a Devise wiki page referencing this post and combining the comments. Please check this wiki page, especially if you’re using Rails 3 and Devise 2: https://github.com/plataformatec/devise/wiki/How-To:-Email-only-sign-up On my Ruby on Rails projects I usually use the Devise gem fo...

Read more

Prevent registration of reserved login

Every time you create a web application where users can register, it is good to exclude some login or username so that they can not be used. A classic example is the login "admin". I believe that no one wishes that in its application will be a registered user with the username "admin" then can contact other users by pretending to be the t...

Read more

How to send email asynchronously using Devise and Rails3

Hello everyone.I’d show a workaround to send email asynchronously using Devise and Rails3.Suppose we have already up and running our application with Devise and delayed_job correctly installed.A first attempt was to add in config/initializers the following file (devise_async.rb):12345678910111213141516#devise_async.rb module Devise module Models module Confirmable handle_asynchronously :send_confirmation_instructions end mod...

Read more

Ruby Enumerables: Operation on hashes

In my last post I talked about Ruby's hash. Today I will resume and complete the argument by describing some of the things you can do to manipulate the hash values. 1. How to iterate over Hash elements The Ruby Hash class provides three different iterators: each, each_key, each_value. There is actually a fourth iterator, each_pair but it is only an alias of each. As you can...

Read more

Ruby Enumerables: Hashes

The most famous framework based on Ruby language, Ruby on Rails, makes extensive use of hash. And cause in our blog we talk mainly about development with Ruby on Rails it seem fair to me to explore some language constructs that are widely used by the Rails framework. In this and in the next posts I will briefly present characteristics and properties of some of the most widely used constructs, starting from Hash. Hashes, also known as associative arrays or dictionaries are very fle...

Read more
Ruby on Rails and jQuery: multiselect with checkbox

Ruby on Rails and jQuery: multiselect with checkbox

Today I want to present a very convenient jQuery plugin I’ve used to create a combo box with checkboxes for a multi-selection field.Suppose we have a form of insertion / modification of user data, and that the user can have multiple functions. We start with rendering the form with a multi-selection field, where you can select more functions with the combination “<ctrl> + cli...

Read more

How-to send email with a Google account form Ruby On Rails

I have seen many articles in the web that explain how to send an email with a Google account from a Ruby On Rails application. However, I believe there are several faulty or incomplete examples around. That’s why I decided to share a working solution that I used in various projects.The main problem with Gmail (or with an address linked to Google Apps) is that prompts for an SSL connecti...

Read more