Browse files

controller setup

  • Loading branch information...
1 parent 121eca1 commit ca0735174b6413efe6a30128e49ca29e3bf999a2 @kevivmatrix committed Nov 10, 2013
View
3 app/assets/javascripts/companies.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://coffeescript.org/
View
3 app/assets/javascripts/employees.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://coffeescript.org/
View
3 app/assets/javascripts/offices.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://coffeescript.org/
View
3 app/assets/stylesheets/companies.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the companies controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
3 app/assets/stylesheets/employees.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the employees controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
3 app/assets/stylesheets/offices.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the offices controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
7 app/controllers/companies_controller.rb
@@ -0,0 +1,7 @@
+class CompaniesController < ApplicationController
+ def index
+ end
+
+ def show
+ end
+end
View
7 app/controllers/employees_controller.rb
@@ -0,0 +1,7 @@
+class EmployeesController < ApplicationController
+ def index
+ end
+
+ def show
+ end
+end
View
7 app/controllers/offices_controller.rb
@@ -0,0 +1,7 @@
+class OfficesController < ApplicationController
+ def index
+ end
+
+ def show
+ end
+end
View
2 app/helpers/companies_helper.rb
@@ -0,0 +1,2 @@
+module CompaniesHelper
+end
View
2 app/helpers/employees_helper.rb
@@ -0,0 +1,2 @@
+module EmployeesHelper
+end
View
2 app/helpers/offices_helper.rb
@@ -0,0 +1,2 @@
+module OfficesHelper
+end
View
2 app/views/companies/index.html.erb
@@ -0,0 +1,2 @@
+<h1>Companies#index</h1>
+<p>Find me in app/views/companies/index.html.erb</p>
View
2 app/views/companies/show.html.erb
@@ -0,0 +1,2 @@
+<h1>Companies#show</h1>
+<p>Find me in app/views/companies/show.html.erb</p>
View
2 app/views/employees/index.html.erb
@@ -0,0 +1,2 @@
+<h1>Employees#index</h1>
+<p>Find me in app/views/employees/index.html.erb</p>
View
2 app/views/employees/show.html.erb
@@ -0,0 +1,2 @@
+<h1>Employees#show</h1>
+<p>Find me in app/views/employees/show.html.erb</p>
View
2 app/views/offices/index.html.erb
@@ -0,0 +1,2 @@
+<h1>Offices#index</h1>
+<p>Find me in app/views/offices/index.html.erb</p>
View
2 app/views/offices/show.html.erb
@@ -0,0 +1,2 @@
+<h1>Offices#show</h1>
+<p>Find me in app/views/offices/show.html.erb</p>
View
56 config/routes.rb
@@ -1,56 +1,10 @@
Serial::Application.routes.draw do
- # The priority is based upon order of creation: first created -> highest priority.
- # See how all your routes lay out with "rake routes".
- # You can have the root of your site routed with "root"
- # root 'welcome#index'
+ resources :companies, only: [:index, :show] do |variable|
+ resources :employees, only: [:index, :show]
+ resources :offices, only: [:index, :show]
+ end
- # Example of regular route:
- # get 'products/:id' => 'catalog#view'
+ root to: "companies#index"
- # 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
View
14 test/controllers/companies_controller_test.rb
@@ -0,0 +1,14 @@
+require 'test_helper'
+
+class CompaniesControllerTest < ActionController::TestCase
+ test "should get index" do
+ get :index
+ assert_response :success
+ end
+
+ test "should get show" do
+ get :show
+ assert_response :success
+ end
+
+end
View
14 test/controllers/employees_controller_test.rb
@@ -0,0 +1,14 @@
+require 'test_helper'
+
+class EmployeesControllerTest < ActionController::TestCase
+ test "should get index" do
+ get :index
+ assert_response :success
+ end
+
+ test "should get show" do
+ get :show
+ assert_response :success
+ end
+
+end
View
14 test/controllers/offices_controller_test.rb
@@ -0,0 +1,14 @@
+require 'test_helper'
+
+class OfficesControllerTest < ActionController::TestCase
+ test "should get index" do
+ get :index
+ assert_response :success
+ end
+
+ test "should get show" do
+ get :show
+ assert_response :success
+ end
+
+end
View
4 test/helpers/companies_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class CompaniesHelperTest < ActionView::TestCase
+end
View
4 test/helpers/employees_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class EmployeesHelperTest < ActionView::TestCase
+end
View
4 test/helpers/offices_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class OfficesHelperTest < ActionView::TestCase
+end

0 comments on commit ca07351

Please sign in to comment.