class User < ActiveRecord::Base
  def self.count_remade_users
  end
end

My guess is that you are missing the "self" part of the method
declaration, which tells ruby that this is a class method.

On May 12, 7:59 am, nirosh <[email protected]> wrote:
> i need to define a custom finction in model which is named as
> "count_remaked_users".
> when i try to access that function from view (<
> %=User.count_remaked_users%>) i'm getting "undefined method" error.
>
> any clue for this?.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to