Skip to content

Commit

Permalink
main controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
afa committed Jul 20, 2010
1 parent 0466f9e commit d8f31a4
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 316 deletions.
9 changes: 9 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
есть тушка body, которой нравятся продукты product. тушка определяется ответами answer на вопросы question

Body habtm answers habtm products

Answer belongs question habtm bodies

Question has many answers

обдумать блокирующие вопросы
5 changes: 5 additions & 0 deletions app/controllers/admin/main_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Admin::MainController < ApplicationController
def index
end

end
5 changes: 5 additions & 0 deletions app/controllers/main_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class MainController < ApplicationController
def index
end

end
2 changes: 2 additions & 0 deletions app/helpers/admin/main_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Admin::MainHelper
end
2 changes: 2 additions & 0 deletions app/helpers/main_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module MainHelper
end
2 changes: 2 additions & 0 deletions app/views/admin/main/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Admin::Main#index</h1>
<p>Find me in app/views/admin/main/index.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/main/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Main#index</h1>
<p>Find me in app/views/main/index.html.erb</p>
42 changes: 1 addition & 41 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.

# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action

# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)

# Sample resource route (maps HTTP verbs to controller actions automatically):
# map.resources :products

# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller

# Sample resource route with more complex sub-resources
# map.resources :products do |products|
# products.resources :comments
# products.resources :sales, :collection => { :recent => :get }
# end

# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
# admin.resources :products
# end

# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
# map.root :controller => "welcome"

# See how all your routes lay out with "rake routes"

# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller accessible via GET requests. You should
# consider removing or commenting them out if you're using named routes and resources.
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
map.index '/', :controller=>'Main', :action=>:index
end
275 changes: 0 additions & 275 deletions public/index.html

This file was deleted.

17 changes: 17 additions & 0 deletions spec/controllers/admin/main_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'spec_helper'

describe Admin::MainController do

#Delete these examples and add some real ones
it "should use Admin::MainController" do
controller.should be_an_instance_of(Admin::MainController)
end


describe "GET 'index'" do
it "should be successful" do
get 'index'
response.should be_success
end
end
end
17 changes: 17 additions & 0 deletions spec/controllers/main_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'spec_helper'

describe MainController do

#Delete these examples and add some real ones
it "should use MainController" do
controller.should be_an_instance_of(MainController)
end


describe "GET 'index'" do
it "should be successful" do
get 'index'
response.should be_success
end
end
end
Loading

0 comments on commit d8f31a4

Please sign in to comment.