Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/controllers/test_feature_toggle_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class TestFeatureToggleController < ApplicationController
before_action -> { authorize_feature(:test_feature_toggle, [User.find_by(login_name: 'kimura'), User.admins]) }
before_action -> { authorized_feature!(:test_feature_toggle) }
def index
@user = User.first
end
end
6 changes: 6 additions & 0 deletions app/views/application/_global_nav.slim
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,9 @@ nav.global-nav
.global-nav__item-count.a-notification-count.is-only-mentor
= Talk.action_uncompleted.count
.global-nav-links__link-label 相談
- if authorized_feature?(:test_feature_toggle)
li.global-nav-links__item
= link_to test_feature_toggle_index_path, class: "global-nav-links__link #{current_link(/^events|^regular_events/)}" do
.global-nav-links__link-icon
i.fa-solid.fa-beer
.global-nav-links__link-label FeatureToggle
1 change: 1 addition & 0 deletions app/views/test_feature_toggle/index.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
= @user.name
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@
resources :movies
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?
mount GoodJob::Engine => 'good_job'

# routes for testing feature toggle on staging env
resources :test_feature_toggle, only: %i(index)
end