RoR - Account - Login - Register + - ruby-on-rails

Is there an automatic way in Ruby On Rails for authentication porpose?
What gem is this and what does it do?
Does it automaticly generate the tables and pages like when i should generate a scaffold?

There are some plugins that do code generation for you, but I strongly prefer Authlogic. Ryan Bates has an excellent introductory video.

I agree that Authlogic is a great choice for Rails authentication.
In addition to the links Alex provided, check out the authlogic_example Git repository for step-by-step setup instructions, including the proper migration to be using. You can still start with nifty_scaffold and then edit the migration, models, and controllers appropriately.

Related

Ruby on Rails Active Record Interface

I'm new in Ruby on Rails, I'm wondering, is there a user interface to see all the data that you have in your Active Record Models and manipulate them just like PhpMyAdmin?
Sadly no - you have to write that interface yourself... :)
There are ways to quickly scaffold up an interface for each of your models. Look at doco on rails generate scaffold for more info.
There are also gems that will automate some admin-scaffolding for you:
Look at eg ActiveAdmin
But in practice nobody keeps either of these around for long in their projects (for various reasons).
If you're new to Rails, I can highly recommend reading your way through the Rails Guides here: http://guides.rubyonrails.org It will help you level up in all the fundamental aspects of Rails :)
There are gems in rails to maintain tables in rails app:
ActiveAdmin: It provides admin panel using which you can add/update/delete any record under tables.
rails_db_info: Just and it under Gemfile and run bundle install. Go to "/rails/info/db" link, it will list all tables with schema details. Its very easy to integrate.

Which is the best way to create a login in Rails for a starter?

I've seen there're several engines and tutorials about it, but I couldn't figure out which one could help me out in short terms. I'm just learning Rails and Ruby and my aim is to understand how it works while it can be useful in a real life event.
Any link or explanation about this will be kindly appreciated!
Other answers are recommending Devise. Devise's own documentation says:
If you are building your first Rails application, we recommend you to not use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch.
I'm inclined to agree. Devise is a great engine that can create a powerful login system for you in minimal time, but if you're building an app for the purpose of learning Rails, I'd recommend following a tutorial to build your own login system so you get a deeper understanding of what's actually going on beneath the hood. You can always come back and use Devise later.
For a tutorial, I'd recommend the same book that Devise recommend, Michael Hartl's Ruby on Rails Tutorial - specifically chapters 6, 7, 8. (Well, I'd recommend the whole book, but those are the chapters that pertain to building a login system.)
If screencasts are more your thing, Ryan Bates's Railscast on the subject
is supposed to be good although I haven't watched it myself.
a gem called devise, as simple as install it and minimal configuration
https://github.com/plataformatec/devise
add it to gem file:
gemfile.rb
gem 'devise'
install :
rails generate devise:install
create User model:
rails generate devise user
and here are the commands you can use:
https://github.com/plataformatec/devise#controller-filters-and-helpers

Ruby on Rails - Login with Session

I'm looking for a good tutorial for Sessions in RoR
Can you recommend me some sites? ( Please not ruby.railstutorial.org/ruby-on-rails-tutorial-book )
Thanks
I'm assuming you're referring to user login/logout functionality - if you're willing to pay for it (I can't recommend enough that you do) Railscast has an excellent episode on authentication: http://railscasts.com/episodes/250-authentication-from-scratch-revised.
There are also free episodes on setting up Devise (a gem that does most of the authentication work for you): http://railscasts.com/episodes/209-introducing-devise - but I would again recommend building your own from scratch first so you understand the logic.
If and when you do decide to jump into Devise, their github pages are very helpful as well so check those out: https://github.com/plataformatec/devise.
http://www.quarkruby.com/2007/10/21/sessions-and-cookies-in-ruby-on-rails
I found the above link very helpful.

Login/Logout process for ROR (Rails 3.2.2)

We are new to ROR, We have issue in creating Login/Logout process in ROR (Rails 3.2.2/ruby 1.9.3p125). Can you please provide some details steps to do below,
How to code for Login/Logout process
How to change the table as well as fields as per my requirement for
it.
How to customize signup and change the table and fields.
Thanks in advance.
Thanks & Regards,
Chirag Patel
Please read about devise gem and devise Wiki
i recommend to use gem called sorcery for such problems. it's really awesome one, i use it in every my project, Visit tutorial
Benefits:
No built-in or generated code
Configuration over Confusion
Keep MVC cleanly separated
Or http://railscasts.com/episodes/270-authentication-in-rails-3-1

Rails plugin for User reg, password recovery, the works?

Is there such a plugin for rails that will do everything for user registrations, or must this all be coded from the ground up using various plugins and combining them or just coding some parts by hand?
Check out AuthLogic and Devise.
These will handle all the registration, login, logout, password reset etc for you.
You still have to do some work, but the logic itself is done for you.
I'm a Rails noob, and of all the authentication gems, I found Devise to be by far the least confusing to learn how to use. Ryan Bates's Railscast on Devise is a great help as well.
Be sure to install the correct gem for the version of Rails you're using.

Resources