I am trying to get it set up, but am having some problems. I can't
seem to access my instance variables. I get an 'undefined method'
error.
My code:
RequestsController.after(:feature=>:view) do |context, feature, args,
block|
Mole::DbMole.mole_it(context, feature,
context.session[:user], :some_var =>
context.instance_variable.get(@foo))
end
My error:
>>> Mole Error: After-Filterundefined method `instance_variable' for #<RequestsController:0xb7694a94>
In your original post:
MyController.before( :feature => :show ) do |context, feature, args,
block| Mole::DbMole.mole_it( context, feature,
context.session[:user_id],
:some_var => context.instance_variable.get(@myVar))
On Apr 13, 9:06 am, "Fernand Galiana" <fernand.gali...@gmail.com>
wrote:
> Hi,
>
> Thanks for the kind words...
>
> The actual method call to get the controller instance variable should be
> context.instance_variable_get and not context.instance_variable.get
>
> -Fernand
>
My code is:
### Code ###
RequestsController.after(:feature=>:view) do |context, feature,
args, block|
Mole::DbMole.mole_it( context, feature,
context.session[:user], :my_foo=>context.instance_variable_get(@foo))
end
### End ###
@foo is definitely set in the view() method, as it is used in the
displayed view.
On Apr 14, 12:53 am, "Fernand Galiana" <fernand.gali...@gmail.com>
wrote:
> Doh !! Sorry, I will update it...
>
> Thanks
>
I changed the call to instance_variable_get() but am getting the
following error:
>>> Mole Error: After-Filternil is not a symbol
My code is:
### Code ###
RequestsController.after(:feature=>:view) do |context, feature,
args, block|
Mole::DbMole.mole_it ( context, feature,
context.session[:user], :my_foo=>context.instance_variable_get(@foo))
end
### End ###
@foo is definitely set in the view() method, as it is used in the
displayed view.
On Apr 14, 12:53 am, "Fernand Galiana" < fernand.gali...@gmail.com>
wrote:
> Doh !! Sorry, I will update it...
>
> Thanks
>
> On 4/13/07, rellik < patrick.schl...@gmail.com> wrote:
>
>
>
> > Thanks. You might consider updating your blog to reflect that.
>
> > In your original post:
>
> > MyController.before ( :feature => :show ) do |context, feature, args,
On Apr 15, 2:35 am, "Fernand Galiana" <fernand.gali...@gmail.com>
wrote:
> Hum... I suspect something went wrong while persisting the mole info...
> I have added some extra debug info to the mole, but in the mean time
> try to stick the following line in the mole/module.rb
>
> I am sure our line# won't match but you should see a rescue block that will
> look something like:
>
> rescue => ca_boom
> klass.mole_log ">> Mole Error: After-Filter " + ca_boom
> end
>
> Add this line to the rescue block
>
> ca_boom.backtrace.each { |l| klass.mole_log l }
>
> And send us the exception trace...
>
> -Fernand
>
> On 4/15/07, rellik <patrick.schl...@gmail.com> wrote:
>
>
>
> > I changed the call to instance_variable_get() but am getting the
> > following error:
> > >>> Mole Error: After-Filternil is not a symbol
>
> > My code is:
>
> > ### Code ###
> > RequestsController.after(:feature=>:view) do |context, feature,
> > args, block|
> > Mole::DbMole.mole_it( context, feature,
> > context.session[:user], :my_foo=>context.instance_variable_get(@foo))
> > end
> > ### End ###
>
> > @foo is definitely set in the view() method, as it is used in the
> > displayed view.
>
> > On Apr 14, 12:53 am, "Fernand Galiana" <fernand.gali...@gmail.com>
> > wrote:
> > > Doh !! Sorry, I will update it...
>
> > > Thanks
>
> > > On 4/13/07, rellik <patrick.schl...@gmail.com> wrote:
>
> > > > Thanks. You might consider updating your blog to reflect that.
>
> > > > In your original post:
>
> > > > MyController.before( :feature => :show ) do |context, feature, args,
Thanks.. this will greatly change the informativeness of the mole
reports :)
On Apr 15, 3:44 am, "Fernand Galiana" <fernand.gali...@gmail.com>
wrote:
> Ah -- The actual call should be instance_variable_get( "@foo" ) and not
> instance_variable_get( @foo )
>
> -Fernand
>
> > > > > RequestsController.after (:feature=>:view) do |context, feature,