This was my suggestion exactly, so if it did not work, we will have to wait
for the sliceheads to weigh in.
..tony..
On Wed, Dec 3, 2008 at 1:18 PM, Eric K Idema <[EMAIL PROTECTED]> wrote:
>
> Not sure this is really what you were suggesting, but I added the
> following to my slice's config (lib/my_slice.rb):
>
> scope.match("/login", :method => :put ).to(:controller => "/
> MerbAuthSlicePassword/Sessions",
> :action => "update").name(:perform_login)
> scope.match("/logout").to(:controller => "/MerbAuthSlicePassword/
> Sessions",
> :action => "destroy").name(:logout)
>
> The slice then works when run with bin/slice. Unfortunately adding
> the same lines to config/router.rb doesn't work, and I don't want
> these lines added to lib/my_slice.rb since there's no problem when the
> slice is installed into a full app.
>
> Another point of interest (going back to before I added those explicit
> routes): In "slice -i" merb.show_routes correctly lists the "/login"
> and "/logout" routes that aren't being found.
>
> Eric
>
> On Dec 3, 2:12 pm, "Tony Mann" <[EMAIL PROTECTED]> wrote:
> > Can you just explicitly add the "/login" route to your slice's router
> file?
> > I imagine this is a namespace issue, and that merb-auth/login would work.
> >
> > ..tony..
> >
> > On Wed, Dec 3, 2008 at 10:34 AM, Eric K Idema <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >
> > > I'm creating a slice that depends on the merb-auth slices. Basically
> > > all I need is the ensure_authenticated filter to protect a few
> > > actions. When my slice is hosted in another app that has all the merb-
> > > auth stuff already setup, everything works beautifully.
> >
> > > What I can't figure out is how to get it to work when running in the
> > > standalone 'bin/slice' environment.
> >
> > > I added this line to my slice's config/router.rb:
> >
> > > slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix =>
> > > "")
> >
> > > I also added the appropriate dependencies to config/init.rb and copied
> > > the merb/merb-auth directory from a freshly generated merb app into my
> > > slice.
> >
> > > The result is that ensure_authenticated works and I'm given the login
> > > form if I access a protected url. But, when submitting the form I get
> > > an error complaining that no routes match "/login".
> >
> > > Any clues?
> >
> > > Eric
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---