Skip to content
02 Jun, 2026

Avtospec

Subscribe
  • About
  • Contact Us
  • Privacy Policy
site mode button
  • Home
  • Insurance Policy
  • Cara Membuat Login Dengan Gem Devise
Cara Membuat Login Dengan Gem Devise
2 mins read
  • Insurance Policy

Cara Membuat Login Dengan Gem Devise

2 June 2026 avtospec0Tagged Cara, dengan, Devise, Gem, Login, Membuat
Apa itu devise?



Devise adalah gem service yang dibuat untuk membuat login logout suatu aplikasi menjadi lebih mudah.

Langkah – langkah implementasi

1.Buat rails project baru dan generate database:

$ rails new devise
$ rake db:create

2. Tambahkan gem devise pada gemfile

 gem 'devise'

3. Install devise

$ bundle install
$ rails generate devise:install

4. Buat devise model “user”

$ rails generate devise User

5. Run migration

$ rake db:migrate

6. Generate view untuk login dan registrasi

$ rails generate devise:views users

7. Generate controller devise users

$ rails generate devise:controllers users

8. Konfigurasi routes untuk login dan registrasi

 #config/routes.rb
  devise_for :users, controllers: { sessions: 'users/sessions' }   
  devise_scope :user do
    get 'sign_in', to: 'devise/sessions#new'
    get '/users/sign_out' => 'devise/sessions#destroy'
  end
  resources :homes
  root to: 'homes#index'


9. Generate controller home dan tambahkan code dibawah

$ rails g controller homes
 #controllers/homes_controller.rb
  class HomesController < ActionController::Base
    before_action :authenticate_user!
    def index
    end
  end

buat file homes pada folder views lalu tambahkan file index.html.erb

 #views/homes/index.html.erb
 <h3>Hello World</h3>
 <%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'navbar-link'  %>

10.Jalankan server

$ rails s

11. Buka url
     
      http://localhost:3000/users/sign_in

kurang lebih hasilnya akan seperti ini:

form sign up:

form login:

untuk selebihnya mengenai gem devise bisa klik link dibawah ini:

selamat mencoba & happy coding :)

PakarPBN

A Private Blog Network (PBN) is a collection of websites that are controlled by a single individual or organization and used primarily to build backlinks to a “money site” in order to influence its ranking in search engines such as Google. The core idea behind a PBN is based on the importance of backlinks in Google’s ranking algorithm. Since Google views backlinks as signals of authority and trust, some website owners attempt to artificially create these signals through a controlled network of sites.

In a typical PBN setup, the owner acquires expired or aged domains that already have existing authority, backlinks, and history. These domains are rebuilt with new content and hosted separately, often using different IP addresses, hosting providers, themes, and ownership details to make them appear unrelated. Within the content published on these sites, links are strategically placed that point to the main website the owner wants to rank higher. By doing this, the owner attempts to pass link equity (also known as “link juice”) from the PBN sites to the target website.

The purpose of a PBN is to give the impression that the target website is naturally earning links from multiple independent sources. If done effectively, this can temporarily improve keyword rankings, increase organic visibility, and drive more traffic from search results.

Jasa Backlink

Download Anime Batch

Post navigation

Previous: Definisi, Manfaat, & Cara Membuatnya
avtospec
Website https://pthrt.id/

Related Posts

Definisi, Manfaat, & Cara Membuatnya
11 mins read
  • Insurance Policy

Definisi, Manfaat, & Cara Membuatnya

31 May 2026 avtospec0
Belajar Ruby on Rails: Seri Belajar Ruby on Rails Bagian 2
4 mins read
  • Insurance Policy

Belajar Ruby on Rails: Seri Belajar Ruby on Rails Bagian 2

29 May 2026 avtospec0
Strategi Load Balancing Terbaik untuk Pengelolaan VPS Hosting
11 mins read
  • Insurance Policy

Strategi Load Balancing Terbaik untuk Pengelolaan VPS Hosting

27 May 2026 avtospec0
  • Cara Membuat Login Dengan Gem Devise
  • Definisi, Manfaat, & Cara Membuatnya
  • Belajar Ruby on Rails: Seri Belajar Ruby on Rails Bagian 2
  • Strategi Load Balancing Terbaik untuk Pengelolaan VPS Hosting
  • Belajar Ruby on Rails: Seri Belajar Ruby on Rails Bagian 9
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • November 2024
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Copyright © ogma blog 2026 Proudly powered by WordPress | Theme: ogma-blog by Mystery Themes.
  • About
  • Contact Us
  • Privacy Policy