Mati M. wrote in post #1109763: > I am a newbie for RoR but I liked it so far. For the current project I > already developed an authenticaion page where the user will be > authenticated before and after login. I know that I will be doing more > projects on RoR in the coming weeks as well and I don't want to copy > paste my codes to enable authentication in my projects. How can I create > an authentication system where I can use it in multiple projects. Are > there any plugins already been developed?
http://guides.rubygems.org/make-your-own-gem/ FYI: Most newcomers, and veterans alike, don't typically reinvent the authentication wheel. They instead use one of the excellent authentication gems that already exist. https://github.com/plataformatec/devise https://github.com/intridea/omniauth > You should also consider that, the authentication system also be on > call (it should be listening everytime the user goes from one page to > another page by checking if s/he is authorized and also the session > haven't expired yet and so on.). That means I still need the > authentication/authorization system to be there even after login. And > how do I integrate it with other ruby projects I will be working on. I > hope it makes sense. > > The database where users will be authorized might be the same or > different based on the projects. You're really talking about two separate things here. Authentication and Authorization. I personally use OmniAuth for authentication and CanCan for authorization. To me this is an excellent combination for most of my needs. https://github.com/ryanb/cancan -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/431ab0667ad07da0229cf0257f530241%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.

