#7 コントローラ等追加
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ gem 'sprockets-rails'
|
|||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
|
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
|
||||||
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
|
# gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
|
||||||
|
|
||||||
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
|
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
|
||||||
gem "brakeman", require: false
|
gem "brakeman", require: false
|
||||||
|
|||||||
@@ -88,9 +88,6 @@ GEM
|
|||||||
connection_pool (2.5.3)
|
connection_pool (2.5.3)
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
date (3.4.1)
|
date (3.4.1)
|
||||||
debug (1.10.0)
|
|
||||||
irb (~> 1.10)
|
|
||||||
reline (>= 0.3.8)
|
|
||||||
dotenv (3.1.8)
|
dotenv (3.1.8)
|
||||||
drb (2.2.1)
|
drb (2.2.1)
|
||||||
ed25519 (1.4.0)
|
ed25519 (1.4.0)
|
||||||
@@ -107,7 +104,7 @@ GEM
|
|||||||
json (2.12.0)
|
json (2.12.0)
|
||||||
jwt (2.10.1)
|
jwt (2.10.1)
|
||||||
base64
|
base64
|
||||||
kamal (2.6.0)
|
kamal (2.6.1)
|
||||||
activesupport (>= 7.0)
|
activesupport (>= 7.0)
|
||||||
base64 (~> 0.2)
|
base64 (~> 0.2)
|
||||||
bcrypt_pbkdf (~> 1.0)
|
bcrypt_pbkdf (~> 1.0)
|
||||||
@@ -315,7 +312,6 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bootsnap
|
bootsnap
|
||||||
brakeman
|
brakeman
|
||||||
debug
|
|
||||||
jwt
|
jwt
|
||||||
kamal
|
kamal
|
||||||
mysql2 (~> 0.5.6)
|
mysql2 (~> 0.5.6)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
class IpAddressesController < ApplicationController
|
||||||
|
def index
|
||||||
|
@ip_addresses = IpAddress.all
|
||||||
|
|
||||||
|
render json: @ip_addresses
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
render json: @ip_address
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class NicoTagRelationController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class PostTagsController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class SettingsController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class TagAliasesController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class TagsController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class UserIpsController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class UserPostViewsController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class UsersController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
class WikiPagesController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
+70
-11
@@ -1,15 +1,74 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
namespace :api do
|
get "wiki_pages/index"
|
||||||
namespace :v1 do
|
get "wiki_pages/show"
|
||||||
resources :posts
|
get "wiki_pages/create"
|
||||||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
get "wiki_pages/update"
|
||||||
|
get "wiki_pages/destroy"
|
||||||
|
get "users/index"
|
||||||
|
get "users/show"
|
||||||
|
get "users/create"
|
||||||
|
get "users/update"
|
||||||
|
get "users/destroy"
|
||||||
|
get "user_post_views/index"
|
||||||
|
get "user_post_views/show"
|
||||||
|
get "user_post_views/create"
|
||||||
|
get "user_post_views/update"
|
||||||
|
get "user_post_views/destroy"
|
||||||
|
get "user_ips/index"
|
||||||
|
get "user_ips/show"
|
||||||
|
get "user_ips/create"
|
||||||
|
get "user_ips/update"
|
||||||
|
get "user_ips/destroy"
|
||||||
|
get "tags/index"
|
||||||
|
get "tags/show"
|
||||||
|
get "tags/create"
|
||||||
|
get "tags/update"
|
||||||
|
get "tags/destroy"
|
||||||
|
get "tag_aliases/index"
|
||||||
|
get "tag_aliases/show"
|
||||||
|
get "tag_aliases/create"
|
||||||
|
get "tag_aliases/update"
|
||||||
|
get "tag_aliases/destroy"
|
||||||
|
get "settings/index"
|
||||||
|
get "settings/show"
|
||||||
|
get "settings/create"
|
||||||
|
get "settings/update"
|
||||||
|
get "settings/destroy"
|
||||||
|
get "post_tags/index"
|
||||||
|
get "post_tags/show"
|
||||||
|
get "post_tags/create"
|
||||||
|
get "post_tags/update"
|
||||||
|
get "post_tags/destroy"
|
||||||
|
get "nico_tag_relation/index"
|
||||||
|
get "nico_tag_relation/show"
|
||||||
|
get "nico_tag_relation/create"
|
||||||
|
get "nico_tag_relation/update"
|
||||||
|
get "nico_tag_relation/destroy"
|
||||||
|
get "ip_addresses/index"
|
||||||
|
get "ip_addresses/show"
|
||||||
|
get "ip_addresses/create"
|
||||||
|
get "ip_addresses/update"
|
||||||
|
get "ip_addresses/destroy"
|
||||||
|
root 'home#index'
|
||||||
|
|
||||||
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
|
resources :posts
|
||||||
# Can be used by load balancers and uptime monitors to verify that the app is live.
|
resources :ip_addresses
|
||||||
get "up" => "rails/health#show", as: :rails_health_check
|
resources :nico_tag_relations
|
||||||
|
resources :post_tags
|
||||||
|
resources :settings
|
||||||
|
resources :tag_aliases
|
||||||
|
resources :tags
|
||||||
|
resources :user_ips
|
||||||
|
resources :user_post_views
|
||||||
|
resources :users
|
||||||
|
resources :wiki_pages
|
||||||
|
|
||||||
# Defines the root path route ("/")
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
||||||
# root "posts#index"
|
|
||||||
end
|
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
|
||||||
end
|
# Can be used by load balancers and uptime monitors to verify that the app is live.
|
||||||
|
# get "up" => "rails/health#show", as: :rails_health_check
|
||||||
|
|
||||||
|
# Defines the root path route ("/")
|
||||||
|
# root "posts#index"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class IpAddressesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get ip_addresses_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get ip_addresses_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get ip_addresses_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get ip_addresses_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get ip_addresses_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class NicoTagRelationControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get nico_tag_relation_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get nico_tag_relation_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get nico_tag_relation_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get nico_tag_relation_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get nico_tag_relation_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class PostTagsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get post_tags_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get post_tags_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get post_tags_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get post_tags_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get post_tags_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class SettingsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get settings_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get settings_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get settings_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get settings_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get settings_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class TagAliasesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get tag_aliases_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get tag_aliases_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get tag_aliases_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get tag_aliases_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get tag_aliases_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class TagsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get tags_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get tags_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get tags_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get tags_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get tags_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class UserIpsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get user_ips_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get user_ips_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get user_ips_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get user_ips_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get user_ips_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class UserPostViewsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get user_post_views_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get user_post_views_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get user_post_views_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get user_post_views_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get user_post_views_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class UsersControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get users_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get users_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get users_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get users_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get users_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class WikiPagesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get wiki_pages_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get wiki_pages_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get wiki_pages_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get update" do
|
||||||
|
get wiki_pages_update_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get destroy" do
|
||||||
|
get wiki_pages_destroy_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user