Can't call helper function!

Hey all,
I have a strange problem…In my controller I have at the top:

class SomeController < ApplicationController
helper :person

In PersonHelper I have:
def get_user_id

curr_user.id
end

In a particular partial (which is rendered via inline RJS by the
controller) under the SomeController class, let’s call it _person.html

I can do the follwing fine:
<%= get_user_id %>

And that works.

However, when I try:
<%= link_to_remote(:url => {:controller => …, :action => …, :id =>
get_user_id}) %>

I get the following error msg:
undefined local variable or method `get_user_id’ for
#<#Class:0x2531580:0x2531558>

Any ideas?
Thanks!

Sorry, typo: change _person.html to _person.rhtml
The problem is still there!

Vishal wrote:

Sorry, typo: change _person.html to _person.rhtml
The problem is still there!

What is even STRANGER(!!) is that calling the helper function
‘get_user_name’ within the link_to_remote works…but NOT
get_user_id. What gives?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs