On Fri, Jun 5, 2009 at 5:47 PM, Petan Cert <[email protected]
> wrote:

>
> I moved all the stuff from my lib/login_system.rb to the
> application_helper.
>

Dont' do this keep your lib/login_system.rb as it is.

restart  server

lib methods are accessible in controller, only problem with views.

If you wanted to access them in view
add following line in your application controller
helper_method :method_name


>
> And I got this ubly error: NoMethodError .... undefined method
> `helper_method' for #<Module:0x75f19f8>
>
> So I added following line to my application_controller:
>
> helper_method :logged_in_user, :check_administrator_role,
> :check_moderator_role, :login_required, :is_logged_in?, :is_admin?
>
> but still no luck. :(
> Still the same error.
>
> Cheers
> P.
>
>
> Sandip Ransing wrote:
> > Hi Petan,
> >
> > instead of using is_logged_in?.
> > give a try for logged_in? method.
> >
> > still problem then define method is_logged_in? method in
> > application_helper
> >
> >   def is_logged_in?
> >     session[:user]
> >   end
> >
> > I hope this will work.
> >
> > -Sandip R~
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


-- 
Ruby on Rails Developer
http://sandip.sosblog.com
http://funonrails.wordpress.com
www.joshsoftware.com

--~--~---------~--~----~------------~-------~--~----~
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