diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js new file mode 100644 index 0000000..dee720f --- /dev/null +++ b/app/assets/javascripts/admin.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/admin.css b/app/assets/stylesheets/admin.css new file mode 100644 index 0000000..afad32d --- /dev/null +++ b/app/assets/stylesheets/admin.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb new file mode 100644 index 0000000..c2a9ad9 --- /dev/null +++ b/app/controllers/admin_controller.rb @@ -0,0 +1,4 @@ +class AdminController < ApplicationController + def index + end +end diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb new file mode 100644 index 0000000..d5c6d35 --- /dev/null +++ b/app/helpers/admin_helper.rb @@ -0,0 +1,2 @@ +module AdminHelper +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ea178ef..2664dfe 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,7 +1,7 @@ module ApplicationHelper def get_title(title = '') - base = 'Calefaction' + base = 'Calefaction' # TODO: replace with settings name thing title.empty? ? base : "#{title} : #{base}" end end diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb new file mode 100644 index 0000000..10dadec --- /dev/null +++ b/app/views/admin/index.html.erb @@ -0,0 +1,4 @@ +<% provide(:title, 'Admin') %> + +

Admin#index

+

Find me in app/views/admin/index.html.erb

diff --git a/app/views/tools/index.html.erb b/app/views/tools/index.html.erb index fcd7c1c..b958c38 100644 --- a/app/views/tools/index.html.erb +++ b/app/views/tools/index.html.erb @@ -1,2 +1,7 @@

Tools#index

-

Find me in app/views/tools/index.html.erb

+ +

Users: SignupLogin

+

Admin: Admin

+

Tools: ...

+ +

[Site description]

diff --git a/config/routes.rb b/config/routes.rb index 5884244..648126f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,7 @@ Rails.application.routes.draw do get '/signup' => 'users#create' get '/login' => 'users#login' + get '/admin' => 'admin#index' # Example of regular route: # get 'products/:id' => 'catalog#view' @@ -11,46 +12,4 @@ Rails.application.routes.draw do # Example of named route that can be invoked with purchase_url(id: product.id) # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end end diff --git a/test/controllers/admin_controller_test.rb b/test/controllers/admin_controller_test.rb new file mode 100644 index 0000000..8d448e9 --- /dev/null +++ b/test/controllers/admin_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class AdminControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + +end