RailsCasts Pro episodes are now free!

Learn more or hide this

Marc-Antoine Duhaime's Profile

GitHub User: maduhaime

Site: www.duhaime.ca

Comments by Marc-Antoine Duhaime


Caution: When using decorators, all your routes are accessibles when prefixed with the h method.


But if you set default url options in your ApplicationController, they will not be apply. In my case, it's the locale setting...

def default_url_options(options={})
{:locale => I18n.locale}


Nice work. Again for those who didn't understand, this screencast should be consider as an introduction to authentication. The purpose of it is not to define all security hole and patch them.

The Devise source code is very good at this. The engine cover a lot of advance features. I suggest everyone to have a look at it and learn from it.

Secure an application is not an easy task to accomplish. I suggest everyone to create a checklist and verify there projects against it.


Thanks again for this great post.

I'm living in Quebec (Canada). Every projects I'm working on must accomodate French an English users. The approch presented in this screencast is very simplice and neary unusable inside medium and large projects.

For us, translation is part of our workflow.

Generally, before beginning a project, we decide the language used by default (language inside the code). English is often appropriate. Then, during the modeling stage, we select names to be used for models and attributes in both french and english. (I'm working on a generator that will create the yml files under config/locales/models/... and the appropriate keys).

Combined with a generic series of translations, this is sufficient for 99% of administrative views. It is very easy to combine with meta_search, simple_form and other gems.

For the translation of database content, views and static views, we use several techniques. It depends on the client context.

Some content must exist simultaneously in both languages. Others do not have this restriction. Some pages are so different from one language to another... So we produce them separately. (about.en.html.erb, about.fr.html.erb...) we also add by composition some methods to the models.

If one day you have any interest, I would be happy to share my screen with Skype and walk you through one of my projects... In English of course!