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 perangkat permata ke gemfile
gem 'devise'
3. Instal perangkat
$ bundle install
$ rails generate devise:install
4. Buat devise model “user”
$ rails generate devise User
5. Jalankan migrasi
$ rake db:migrate
6. Generate view untuk login dan registrasi
$ rails generate devise:views users
7. Menghasilkan pengguna perangkat pengontrol
$ 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 indeks.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:
formulir pendaftaran:
formulir masuk:

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.
Comments are closed, but trackbacks and pingbacks are open.