-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3f1243
commit b3a6458
Showing
36 changed files
with
591 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
class AchievementKategoriListsController < ApplicationController | ||
before_action :set_achievement_kategori_list, only: %i[ show edit update destroy ] | ||
|
||
# GET /achievement_kategori_lists or /achievement_kategori_lists.json | ||
def index | ||
@achievement_kategori_lists = AchievementKategoriList.all | ||
end | ||
|
||
# GET /achievement_kategori_lists/1 or /achievement_kategori_lists/1.json | ||
def show | ||
end | ||
|
||
# GET /achievement_kategori_lists/new | ||
def new | ||
@achievement_kategori_list = AchievementKategoriList.new | ||
end | ||
|
||
# GET /achievement_kategori_lists/1/edit | ||
def edit | ||
end | ||
|
||
# POST /achievement_kategori_lists or /achievement_kategori_lists.json | ||
def create | ||
@achievement_kategori_list = AchievementKategoriList.new(achievement_kategori_list_params) | ||
|
||
respond_to do |format| | ||
if @achievement_kategori_list.save | ||
format.html { redirect_to achievement_kategori_list_url(@achievement_kategori_list), notice: "Achievement kategori list was successfully created." } | ||
format.json { render :show, status: :created, location: @achievement_kategori_list } | ||
else | ||
format.html { render :new, status: :unprocessable_entity } | ||
format.json { render json: @achievement_kategori_list.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PATCH/PUT /achievement_kategori_lists/1 or /achievement_kategori_lists/1.json | ||
def update | ||
respond_to do |format| | ||
if @achievement_kategori_list.update(achievement_kategori_list_params) | ||
format.html { redirect_to achievement_kategori_list_url(@achievement_kategori_list), notice: "Achievement kategori list was successfully updated." } | ||
format.json { render :show, status: :ok, location: @achievement_kategori_list } | ||
else | ||
format.html { render :edit, status: :unprocessable_entity } | ||
format.json { render json: @achievement_kategori_list.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /achievement_kategori_lists/1 or /achievement_kategori_lists/1.json | ||
def destroy | ||
@achievement_kategori_list.destroy! | ||
|
||
respond_to do |format| | ||
format.html { redirect_to achievement_kategori_lists_url, notice: "Achievement kategori list was successfully destroyed." } | ||
format.json { head :no_content } | ||
end | ||
end | ||
|
||
private | ||
# Use callbacks to share common setup or constraints between actions. | ||
def set_achievement_kategori_list | ||
@achievement_kategori_list = AchievementKategoriList.find(params[:id]) | ||
end | ||
|
||
# Only allow a list of trusted parameters through. | ||
def achievement_kategori_list_params | ||
params.require(:achievement_kategori_list).permit(:kategori) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
class AchievementTingkatListsController < ApplicationController | ||
before_action :set_achievement_tingkat_list, only: %i[ show edit update destroy ] | ||
|
||
# GET /achievement_tingkat_lists or /achievement_tingkat_lists.json | ||
def index | ||
@achievement_tingkat_lists = AchievementTingkatList.all | ||
end | ||
|
||
# GET /achievement_tingkat_lists/1 or /achievement_tingkat_lists/1.json | ||
def show | ||
end | ||
|
||
# GET /achievement_tingkat_lists/new | ||
def new | ||
@achievement_tingkat_list = AchievementTingkatList.new | ||
end | ||
|
||
# GET /achievement_tingkat_lists/1/edit | ||
def edit | ||
end | ||
|
||
# POST /achievement_tingkat_lists or /achievement_tingkat_lists.json | ||
def create | ||
@achievement_tingkat_list = AchievementTingkatList.new(achievement_tingkat_list_params) | ||
|
||
respond_to do |format| | ||
if @achievement_tingkat_list.save | ||
format.html { redirect_to achievement_tingkat_list_url(@achievement_tingkat_list), notice: "Achievement tingkat list was successfully created." } | ||
format.json { render :show, status: :created, location: @achievement_tingkat_list } | ||
else | ||
format.html { render :new, status: :unprocessable_entity } | ||
format.json { render json: @achievement_tingkat_list.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PATCH/PUT /achievement_tingkat_lists/1 or /achievement_tingkat_lists/1.json | ||
def update | ||
respond_to do |format| | ||
if @achievement_tingkat_list.update(achievement_tingkat_list_params) | ||
format.html { redirect_to achievement_tingkat_list_url(@achievement_tingkat_list), notice: "Achievement tingkat list was successfully updated." } | ||
format.json { render :show, status: :ok, location: @achievement_tingkat_list } | ||
else | ||
format.html { render :edit, status: :unprocessable_entity } | ||
format.json { render json: @achievement_tingkat_list.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /achievement_tingkat_lists/1 or /achievement_tingkat_lists/1.json | ||
def destroy | ||
@achievement_tingkat_list.destroy! | ||
|
||
respond_to do |format| | ||
format.html { redirect_to achievement_tingkat_lists_url, notice: "Achievement tingkat list was successfully destroyed." } | ||
format.json { head :no_content } | ||
end | ||
end | ||
|
||
private | ||
# Use callbacks to share common setup or constraints between actions. | ||
def set_achievement_tingkat_list | ||
@achievement_tingkat_list = AchievementTingkatList.find(params[:id]) | ||
end | ||
|
||
# Only allow a list of trusted parameters through. | ||
def achievement_tingkat_list_params | ||
params.require(:achievement_tingkat_list).permit(:tingkat) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module AchievementKategoriListsHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module AchievementTingkatListsHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class AchievementKategoriList < ApplicationRecord | ||
validates :kategori, presence: true, length: {minimum: 4, maximum: 15}, uniqueness: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class AchievementTingkatList < ApplicationRecord | ||
validates :tingkat, presence: true, length: {minimum: 4, maximum: 15}, uniqueness: true | ||
end |
7 changes: 7 additions & 0 deletions
7
app/views/achievement_kategori_lists/_achievement_kategori_list.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div id="<%= dom_id achievement_kategori_list %>"> | ||
<p> | ||
<strong>Kategori:</strong> | ||
<%= achievement_kategori_list.kategori %> | ||
</p> | ||
|
||
</div> |
2 changes: 2 additions & 0 deletions
2
app/views/achievement_kategori_lists/_achievement_kategori_list.json.jbuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
json.extract! achievement_kategori_list, :id, :kategori, :created_at, :updated_at | ||
json.url achievement_kategori_list_url(achievement_kategori_list, format: :json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<%= form_with(model: achievement_kategori_list) do |form| %> | ||
<% if achievement_kategori_list.errors.any? %> | ||
<div style="color: red"> | ||
<h2><%= pluralize(achievement_kategori_list.errors.count, "error") %> prohibited this achievement_kategori_list from being saved:</h2> | ||
|
||
<ul> | ||
<% achievement_kategori_list.errors.each do |error| %> | ||
<li><%= error.full_message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div> | ||
<%= form.label :kategori, style: "display: block" %> | ||
<%= form.text_field :kategori %> | ||
</div> | ||
|
||
<div> | ||
<%= form.submit %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1>Editing achievement kategori list</h1> | ||
|
||
<%= render "form", achievement_kategori_list: @achievement_kategori_list %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Show this achievement kategori list", @achievement_kategori_list %> | | ||
<%= link_to "Back to achievement kategori lists", achievement_kategori_lists_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<h1>Achievement kategori lists</h1> | ||
|
||
<div id="achievement_kategori_lists"> | ||
<% @achievement_kategori_lists.each do |achievement_kategori_list| %> | ||
<%= render achievement_kategori_list %> | ||
<p> | ||
<%= link_to "Show this achievement kategori list", achievement_kategori_list %> | ||
</p> | ||
<% end %> | ||
</div> | ||
|
||
<%= link_to "New achievement kategori list", new_achievement_kategori_list_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.array! @achievement_kategori_lists, partial: "achievement_kategori_lists/achievement_kategori_list", as: :achievement_kategori_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<h1>New achievement kategori list</h1> | ||
|
||
<%= render "form", achievement_kategori_list: @achievement_kategori_list %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Back to achievement kategori lists", achievement_kategori_lists_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<%= render @achievement_kategori_list %> | ||
|
||
<div> | ||
<%= link_to "Edit this achievement kategori list", edit_achievement_kategori_list_path(@achievement_kategori_list) %> | | ||
<%= link_to "Back to achievement kategori lists", achievement_kategori_lists_path %> | ||
|
||
<%= button_to "Destroy this achievement kategori list", @achievement_kategori_list, method: :delete %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.partial! "achievement_kategori_lists/achievement_kategori_list", achievement_kategori_list: @achievement_kategori_list |
7 changes: 7 additions & 0 deletions
7
app/views/achievement_tingkat_lists/_achievement_tingkat_list.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div id="<%= dom_id achievement_tingkat_list %>"> | ||
<p> | ||
<strong>Tingkat:</strong> | ||
<%= achievement_tingkat_list.tingkat %> | ||
</p> | ||
|
||
</div> |
2 changes: 2 additions & 0 deletions
2
app/views/achievement_tingkat_lists/_achievement_tingkat_list.json.jbuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
json.extract! achievement_tingkat_list, :id, :tingkat, :created_at, :updated_at | ||
json.url achievement_tingkat_list_url(achievement_tingkat_list, format: :json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<%= form_with(model: achievement_tingkat_list) do |form| %> | ||
<% if achievement_tingkat_list.errors.any? %> | ||
<div style="color: red"> | ||
<h2><%= pluralize(achievement_tingkat_list.errors.count, "error") %> prohibited this achievement_tingkat_list from being saved:</h2> | ||
|
||
<ul> | ||
<% achievement_tingkat_list.errors.each do |error| %> | ||
<li><%= error.full_message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div> | ||
<%= form.label :tingkat, style: "display: block" %> | ||
<%= form.text_field :tingkat %> | ||
</div> | ||
|
||
<div> | ||
<%= form.submit %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1>Editing achievement tingkat list</h1> | ||
|
||
<%= render "form", achievement_tingkat_list: @achievement_tingkat_list %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Show this achievement tingkat list", @achievement_tingkat_list %> | | ||
<%= link_to "Back to achievement tingkat lists", achievement_tingkat_lists_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<h1>Achievement tingkat lists</h1> | ||
|
||
<div id="achievement_tingkat_lists"> | ||
<% @achievement_tingkat_lists.each do |achievement_tingkat_list| %> | ||
<%= render achievement_tingkat_list %> | ||
<p> | ||
<%= link_to "Show this achievement tingkat list", achievement_tingkat_list %> | ||
</p> | ||
<% end %> | ||
</div> | ||
|
||
<%= link_to "New achievement tingkat list", new_achievement_tingkat_list_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.array! @achievement_tingkat_lists, partial: "achievement_tingkat_lists/achievement_tingkat_list", as: :achievement_tingkat_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<h1>New achievement tingkat list</h1> | ||
|
||
<%= render "form", achievement_tingkat_list: @achievement_tingkat_list %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Back to achievement tingkat lists", achievement_tingkat_lists_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<%= render @achievement_tingkat_list %> | ||
|
||
<div> | ||
<%= link_to "Edit this achievement tingkat list", edit_achievement_tingkat_list_path(@achievement_tingkat_list) %> | | ||
<%= link_to "Back to achievement tingkat lists", achievement_tingkat_lists_path %> | ||
|
||
<%= button_to "Destroy this achievement tingkat list", @achievement_tingkat_list, method: :delete %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.partial! "achievement_tingkat_lists/achievement_tingkat_list", achievement_tingkat_list: @achievement_tingkat_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
db/migrate/20240124014244_create_achievement_tingkat_lists.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class CreateAchievementTingkatLists < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :achievement_tingkat_lists do |t| | ||
t.string :tingkat | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
db/migrate/20240124014337_create_achievement_kategori_lists.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class CreateAchievementKategoriLists < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :achievement_kategori_lists do |t| | ||
t.string :kategori | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.