Daftar Isi
Ransack
is a Ruby gem that allows searching and filtering data in the Active Record model in a very flexible and simple way. This is particularly useful in Ruby on Rails applications that require searching or filtering data based on specific columns.
First we need to enter the “ransack” gem into the Gemfile
gem 'ransack', '~> 4.2.1'
Next step we need to create a controller for example user class like below
class UsersController < ApplicationController
def index
@q = User.ransack(params[:q])
@users = @q.result(distinct: true)
end
end
After that we need to create a view in app/views/users/index.html.erb like in the example below:
<%= search_form_for @q, url: users_path, method: :get do |f| %>
<%= f.label :name_cont, "Nama" %><%= f.search_field :name_cont %>
<%= f.label :age_cont, "Usia" %><%= f.search_field :age_cont %>
<%= f.label :email_cont, "Email" %><%= f.search_field :email_cont %>
<%= f.submit "Cari" %><% end %>
Also enter the routes for /users in config/routes.rb
resources :users
In the user.rb model we need to set the User model class fields to be set to self.ransackable_attributes , for example like this
class User < ApplicationRecord
def self.ransackable_attributes(auth_object = nil)
["age", "created_at", "email", "id", "name", "updated_at"]
end
end
Here are the results:
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.
