[Rails] ? Password Protection ?

Michael Schreifels technel at gmail.com
Tue Jul 25 22:13:37 GMT 2006


On 7/25/06, Mason Kessinger <masonkessinger at gmail.com> wrote:
> Say I have some directories I want to password protect.
>
> sub.web-app.com/cms
> sub.web-app.com/cms_posts
> sub.web-app.com/cms_photos
> sub.web-app.com/cms_news
>
> where /cms is a page that allows access(links) to all three other cms
> pages.
>
> - - -
>
> Does anyone have any quick advice on how to password protect these
> areas?
>
> Any good online tutorials?
>
> Any advice?

Not sure what type of password protection you are referring to. If you
use Apache, you could use .htaccess to password protect though. If you
mean like a prompt on the page for a username/password login-type
system, why don't you just have one controller "admin" with actions
for posts, photos, and news. IIRC, you can also have controllers
inherit from others (??). So you could have something like /cms/posts
and you could apply a before_filter to all of them. That could get
cluttered, so you may also choose to consider in-place editing as
well, which would eliminate the need for a admin directory at all.

Hope that helps!


More information about the Rails mailing list