Skip to content

Commit

Permalink
First search layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Villalba committed Nov 20, 2010
1 parent 838c924 commit e9c037c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 65 deletions.
6 changes: 6 additions & 0 deletions app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class SearchController < ApplicationController

def show
end

end
18 changes: 18 additions & 0 deletions app/views/layouts/application.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
!!! Strict
%html{ :xmlns => "http://www.w3.org/1999/xhtml", 'xml:lang'=>"en", :lang=>"en" }
%head
%title Devsurfing
= stylesheet_link_tag :all
= javascript_include_tag :defaults
= csrf_meta_tag

%body
%ul
%li= link_to "Home", root_path
%li= link_to "All offices", offices_path

= form_tag '/search/', :method => :get do
= text_field_tag :location, params[:location]
= submit_tag 'Find an office to surf'

= yield
14 changes: 0 additions & 14 deletions app/views/layouts/application.html.erb

This file was deleted.

1 change: 1 addition & 0 deletions app/views/offices/_office.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%h2= office.name
3 changes: 3 additions & 0 deletions app/views/search/show.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
%h1== Results for <em>#{params[:location]}</em>

= render Office.all
Empty file.
52 changes: 1 addition & 51 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,58 +1,8 @@
Devsurfing::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.

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

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

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

# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end

# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end

# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end

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

resources :offices

match 'search' => 'search#show'
root :to => "home#index"

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

# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'
end

0 comments on commit e9c037c

Please sign in to comment.