For what it's worth, I has a similar problem just now, and it turned out that the
slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix => "") in Router.prepare wasn't loaded correctly – I was running "merb -p 1234" via the terminal and even thought it seemed like merb got re- loaded, the restarting of it quit with an "already loaded on port 1234" error and a subsequent reload of the page in the browser suddenly revived merb's output in the terminal. So I assumed merb was never "properly" restarted and I killed off the ruby processes and re- start merb again with "merb -p" and it worked. That's for OS X 10.5, merb 1.0.3 and ruby 1.8.6. On Dec 3, 10:25 pm, "Tony Mann" <[email protected]> wrote: > 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 -~----------~----~----~----~------~----~------~--~---
