Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Created a simple WidgetsController with show and edit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Pierson committed Feb 10, 2010
1 parent 4475940 commit dfa9754
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/widgets_controller.rb
@@ -0,0 +1,2 @@
class WidgetsController < ApplicationController
end
3 changes: 3 additions & 0 deletions app/views/widgets/edit.html.erb
@@ -0,0 +1,3 @@
This is edit.html.erb.
<br/>
Your test appears to be working correctly.
2 changes: 2 additions & 0 deletions app/views/widgets/show.html.erb
@@ -0,0 +1,2 @@
This is widget/show.html.erb.<br/>
<%= link_to "Go to edit page", edit_widget_path %>
4 changes: 3 additions & 1 deletion config/routes.rb
@@ -1,6 +1,8 @@
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.

map.resource :widget

# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
Expand All @@ -17,7 +19,7 @@

# 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
Expand Down

0 comments on commit dfa9754

Please sign in to comment.