Generate Units::Defaults controller

bin/rails g controller Units/Defaults index
This commit is contained in:
cryptogopher 2024-05-04 01:53:57 +02:00
parent b4212298df
commit 965cb76f1d
5 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,8 @@
class Units::DefaultsController < ApplicationController
before_action except: :index do
raise AccessForbidden unless current_user.at_least(:admin)
end
def index
end
end

View File

@ -0,0 +1,2 @@
module Units::DefaultsHelper
end

View File

@ -0,0 +1,2 @@
<h1>Units::Defaults#index</h1>
<p>Find me in app/views/units/defaults/index.html.erb</p>

View File

@ -8,6 +8,10 @@ Rails.application.routes.draw do
end
end
namespace :units do
get 'defaults/index'
end
resources :users, only: [:index, :show, :update] do
member do
get :disguise

View File

@ -0,0 +1,8 @@
require "test_helper"
class Units::DefaultsControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get units_defaults_index_url
assert_response :success
end
end