Created
December 29, 2011 02:38
-
-
Save lscott3/1531341 to your computer and use it in GitHub Desktop.
Nested Resource Problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='new-category'> | |
<h4>Add a new category</h4> | |
<div id="error-space"></div> | |
<%= form_for([@account.vanity_url, @new_category]) do |cat| %> | |
<%= cat.text_field :name %> | |
<%= cat.submit %> | |
<% end -%> | |
<%= link_to "Close", "#", :id => "close" %> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Consultant::Application.routes.draw do | |
resources :packages | |
match "/:package/signup/" => "accounts#new", :as => :signup | |
resource :people | |
resource :fields | |
resource :user_session | |
resource :users | |
resources :accounts, :only => [:create] | |
match ':controller/page/:page' => ':controller#index' | |
match ':controller/:id/page/:page' => ':controller#show' | |
#Nested Resource for Companies/Items | |
scope "/:vanity_url", :as => :workspace do | |
#AJAX Routes | |
match '/category/:category_name' => 'categories#item_list_index', :as => :list_items_by_category, :via => [:get] | |
match '/category_check' => 'categories#category_check' | |
match '/load_attribute' => 'items#load_attribute' | |
match '/add_new_item' => 'companies#add_new_item' | |
match '/item_select' => 'service_records#item_select', :as => :item_select, :via => [:get] | |
#match "/" => "dashboard#index", :as => :root | |
match "/login" => "user_sessions#new", :as => :login | |
match "/logout" => "user_sessions#destroy", :as => :logout | |
match "/" => "dashboard#index", :as => :dashboard | |
resources :accounts, :only => [:show, :edit, :destroy] | |
resources :companies, :path => '/clients' do | |
resources :items | |
resources :notes | |
resources :service_records | |
resources :people | |
end | |
resources :service_records, :categories | |
resources :items do | |
resources :notes | |
end | |
resources :people do | |
resources :notes | |
end | |
resource :items, :only => [:index] | |
resources :password_resets | |
resources :users | |
#Other Routes | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment