Archive for the ‘Development’ Category

2

COMMENTS

How to insert more Disqus comments box in a single page

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, [...]

GO
13

COMMENTS

Two step signup with Devise

On my Ruby on Rails projects I usually use the Devise gem for user authentication.
In the last application I need to customize Devise so that users can register providing email address only. I will ask for a password only at the confirmation step.
After some tests, I come with this solutions.
1. First I need to overwrite [...]

GO
5

COMMENTS

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

GO
4

COMMENTS

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

    module Recoverable
      [...]


GO
8

COMMENTS

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

GO

Copyright 2012 DevInterface s.n.c.

DevInterface Blog is proudly powered by WordPress