Swapnil Sawant Swapnil Sawant - 1 year ago 66
Ruby Question

How to implement a login functionality without a database?

I want to create a login page for my project and validate a user without using any database.How can i do this? Is it possible with cache? Please guide me.

Answer Source

You could use HTTP Basic Authentication ? For reference, here is the railscast.

And an example :

before_filter :authenticate


def authenticate
  authenticate_or_request_with_http_basic do |username, password|
    username == "foo" && password == "bar"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download