On Thu, Nov 20, 2008 at 8:40 AM, Aurels <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> Suppose I have a slice for a given functionality and its admin section
> is inside it.
> Is it possible, when importing the slice's routes into the app
> router.rb to apply a merb-auth authenticate block
> to only the admin routes?
>
> slice(:my_wonderful_merb_slice, :name_prefix => nil, :path_prefix =>
> "")
>
> authenticate do
> end
>
> Thanks!
>
> Aurélien
>

Not sure what you mean here.  You mean the slice adds many routes and you
want to protect a subset of them?

In your setup router you whould be able to do something like

 scope.authenticate do
    # do the admin routes here
  end

Or, if you have trouble just use before :ensure_authenticated in your
controller

HTH.
Daniel

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

Reply via email to