apotonick/apotomo — Issue #45: after_initialize bug
Author: xrorox
Created: 2011-10-17 10:15:56+00:00
State: open

Hi,

I have found a bug in apotomo's hooks.

#gère l'affichage des onglets. L'onglet terminer n'apparait que si on passe la session
def onglets

setup!
render
end

private
def setup!
@corrige =options[:corrige]
end

This works as expected. But if you try to DRY this, this way :

after_initialize :setup!

def onglets

setup!
render
end

private
def setup!
@corrige =options[:corrige]
end

My var, @corrige is null.

I'm on ruby 1.9.2, rails 3.1.1, apotomo 1.4

I suggest we remove this hook, and update apotomo tuto, with a before_filter.

Cause this works:

before_filter :setup!

def onglets

setup!
render
end

private
def setup!
@corrige =options[:corrige]
end