Search code examples
ruby-on-railsruby-on-rails-plugins

simple user authentication and creation plugin in rails?


i have a simple record system in rails, it has customers, appointments and visits as models.

with visits and appointments belonging to customer.

i want a simple authentication plug-in for the owner of the application, to be able to log in and edit and create new data in the system (administrator user) and be able to add new admin users to be able to log in to the system.

a plus would be if the plug-in allowed the admin user to also create customer accounts for customers to be able to go on line check their own customer profile, appointments and visits details.

so basically a authentication plug-in for a super user and a limited user (to view their own profiles).

i don't want anything too fancy to be honest like sending a verification e mail etc.

thanks


Solution

  • Checkout Devise:

    http://github.com/plataformatec/devise

    There's a couple railscasts on it:

    http://railscasts.com/episodes/209-introducing-devise

    For role-based auth you can combine Devise with Cacan:

    http://railscasts.com/episodes/192-authorization-with-cancan http://gist.github.com/389299 http://railscasts.com/episodes/210-customizing-devise