Make/Create Authentication Website in Ruby On Rails Just In 5 Minutes

Hey Friends, Make/Create Authentication Website in Ruby On Rails Just In 5 Minutes



If You really want be a developer and don't know much about programming, then First thing first, its really need to learn best coding to become a good developer, and Ruby On Rails will help you to do this great job. ok Here I'm giving a example to do these steps for Make/Create Authentication Website in Ruby On Rails Just In 5 Minutes


In first minute, go to the terminal and create a rails application first, with this step,

> rails new blog -T -d mysql

if you already add, ruby,  homebrew(for mac), I'm using mac so I'm suing homebrew, rails, mysql then just run this command, and its will create a BLOG name application, you guys can skip bundle, but here i added this too, so now this command will run these files,

create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/views/layouts/application.html.erb
      create  app/assets/images/.keep
      create  app/mailers/.keep
      create  app/models/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/bundle
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/secrets.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/robots.txt
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep

         run  bundle install

2. now guys will see that, its also running lots of gems, here is the list, which is default gems of ruby and rails.
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.1
Using minitest 5.5.0
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.2.0
Using builder 3.2.2
Using erubis 2.7.0
Installing mini_portile 0.6.2
Using nokogiri 1.6.5
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.5
Using loofah 2.0.1
Using rails-html-sanitizer 1.0.1
Using actionview 4.2.0
Using rack 1.6.0
Using rack-test 0.6.2
Using actionpack 4.2.0
Using globalid 0.3.0
Using activejob 4.2.0
Using mime-types 2.4.3
Using mail 2.6.3
Using actionmailer 4.2.0
Using activemodel 4.2.0
Using arel 6.0.0
Using activerecord 4.2.0
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using bundler 1.7.9
Using columnize 0.9.0
Using debugger-linecache 1.2.0
Using slop 3.6.0
Using byebug 3.5.1
Using coffee-script-source 1.8.0
Using execjs 2.2.2
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.2.0
Using coffee-rails 4.1.0
Using hike 1.2.3
Using multi_json 1.10.1
Using jbuilder 2.2.6
Installing jquery-rails 4.0.3
Using mysql2 0.3.17
Using tilt 1.4.1
Using sprockets 2.12.3
Using sprockets-rails 2.2.2
Using rails 4.2.0
Using rdoc 4.2.0
Using sass 3.4.9
Using sass-rails 5.0.1
Using sdoc 0.4.1
Using spring 1.2.0
Using turbolinks 2.5.3
Installing uglifier 2.6.1
Using web-console 2.0.0
Your bundle is complete!

Now
3. Third thing, you guys will create database for this project, run this command

rake db:create

Note: be sure you are in the exact path, where you create a blog name website.

this command will make a database for your dummy site name BLOG

4. Now Use Devise gem, for authentication part

> gem install devise and set the route in your routes directory and also set gem 'devise' in your Gemfile like this

gem 'devise'
Run the bundle command to install it.
After you install Devise and add it to your Gemfile, you need to run the generator:
rails generate devise:install
The generator will install an initializer which describes ALL of Devise's configuration options. It isimperative that you take a look at it. When you are done, you are ready to add Devise to any of your models using the generator:
rails generate devise MODEL
Replace thsi MODEL name to your model name, we are making users here for authentication, so we are using this command
> rails generate devise User

Part 2 Continues.....

Comments