Browse Source

Admin things.

old-ruby
Ben Kurtovic 9 years ago
parent
commit
2a40d7dbfd
9 changed files with 33 additions and 44 deletions
  1. +2
    -0
      app/assets/javascripts/admin.js
  2. +4
    -0
      app/assets/stylesheets/admin.css
  3. +4
    -0
      app/controllers/admin_controller.rb
  4. +2
    -0
      app/helpers/admin_helper.rb
  5. +1
    -1
      app/helpers/application_helper.rb
  6. +4
    -0
      app/views/admin/index.html.erb
  7. +6
    -1
      app/views/tools/index.html.erb
  8. +1
    -42
      config/routes.rb
  9. +9
    -0
      test/controllers/admin_controller_test.rb

+ 2
- 0
app/assets/javascripts/admin.js View File

@@ -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.

+ 4
- 0
app/assets/stylesheets/admin.css View File

@@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/

+ 4
- 0
app/controllers/admin_controller.rb View File

@@ -0,0 +1,4 @@
class AdminController < ApplicationController
def index
end
end

+ 2
- 0
app/helpers/admin_helper.rb View File

@@ -0,0 +1,2 @@
module AdminHelper
end

+ 1
- 1
app/helpers/application_helper.rb View File

@@ -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

+ 4
- 0
app/views/admin/index.html.erb View File

@@ -0,0 +1,4 @@
<% provide(:title, 'Admin') %>

<h1>Admin#index</h1>
<p>Find me in app/views/admin/index.html.erb</p>

+ 6
- 1
app/views/tools/index.html.erb View File

@@ -1,2 +1,7 @@
<h1>Tools#index</h1>
<p>Find me in app/views/tools/index.html.erb</p>

<p>Users: <a href="/signup">Signup</a> &bull; <a href="/login">Login</a></p>
<p>Admin: <a href="/admin">Admin</a></p>
<p>Tools: ...</p>

<p>[Site description]</p>

+ 1
- 42
config/routes.rb View File

@@ -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

+ 9
- 0
test/controllers/admin_controller_test.rb View File

@@ -0,0 +1,9 @@
require 'test_helper'

class AdminControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end

end

Loading…
Cancel
Save