The 15 best gems for ruby on rails web applications

The 15 best gems for ruby on rails web applications

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

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 Gemfile beca...

Read more

How to insert more Disqus comments box in a single page

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

Hello everyone! For those not familiar Disqus is a platform that allows you to easily insert a box for comments on any website and allows users to use the their Facebook or Twitter account (but not only) to authenticate. The limit of Disqus is that it associates any thread of comments to a unique url. Consequently, it will expect that in every page there is only a comment box. In most cases this limit is acceptable, but for some applications it is useful to put more comm...

Read more

Tips: Multiple pagination with will_paginate

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

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 ...

Read more
Ruby on Rails and jQuery: multiselect with checkbox

Ruby on Rails and jQuery: multiselect with checkbox

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

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> + click “.123456789101112<%= simple_form_for(@user) do |f| %> <%= f.label...

Read more

Different layout for the same controller

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

In some projects can happen that you have to use different graphic templates for different methods of the same controller. At first sight one would implement a solution that provides an explicit call to the desired layout within each action.Something like this:123456789101112131415161718192021class PostController < ApplicationController def index [...] :layout => 'standard' end def show [...] :layout => 'standard' end def new [...] :layout =...

Read more

Rails Best Practices 6: Filters and helpers file

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

With the today’s post I shall conclude my series on Ruby On Rails Best Practices . This is not because the required topics are completed, but rather because after the release of Rails 3.0, some constructs have been changed and should be reviewed. Probably in future we will return to talk about best practices, but starting from the new features introduced in the current Rails version. But now I will describe two techniques that are valid and which are mainly related to code or...

Read more