Hello Team,

This works great. I simply replaced :login action with the path to
login page.

  def index;
    if current_user.guest?
       redirect_to "/login"
    end
  end

You guys are the best ever!  Happy Holiday!

Thanks again,
Sean

On Dec 14, 2:05 pm, Bryan Larsen <[email protected]> wrote:
> The standard pattern is to set this up as a before_filter in
> application_controller.rb.  That way you can apply this to every
> action, not just the front index.
>
> Bryan
>
> On Dec 14, 3:42 pm, Brett Nelson <[email protected]> wrote:
>
> > Was just trying to figure out how to do something like this and came
> > up with a solution.  It redirects to the login page unless the user is
> > logged in.  I added this code to the index method of the front
> > controller and it seems to work.
>
> >     if current_user.guest?
> >       redirect_to :login
> >     end
>
> > Am still testing it though...
>
> > Brett
>
> > On Dec 14, 12:13 pm, Hobo_Fan <[email protected]> wrote:
>
> > > Hi All,
>
> > > I think this question has been asked before by another user. Is it
> > > possible to have the main login page as home page? Once user log into
> > > from the main logon page, it will redirect the page to the normal page
> > > that has tabs on it. Is it possible to do it? How do I implement this?
>
> > > Thanks,
> > > Sean

--

You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.


Reply via email to