Skip to content

Commit

Permalink
Continuing cleanup for initial exposition of app in Arch chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
armandofox committed Sep 9, 2011
1 parent ee09e04 commit 97bf97f
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 301 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

*~
TAGS
db/schema.rb
log/
db/*.sqlite3
db/*.sqlite3
8 changes: 6 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ of RottenPotatoes was created with Rails 3.0.5 and Ruby 1.8.7 using the
commands:

* <tt>rails new rottenpotatoes -J -T</tt>
* <tt>rails generate resource movie title:string rating:string released_on:datetime</tt>
* <tt>cd rottenpotatoes</tt>
* <tt>rails generate resource movie title:string rating:string description:text released_on:datetime</tt>
* <tt>rake db:migrate</tt>
* <tt>rails generate cucumber:install</tt>
* <tt>rails generate rspec:install</tt>
* <tt>rm public/index.html</tt>


and then filling in the basic code for the Movie model, views and controller.

1. At the command prompt, create a new Rails application:
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
Expand Down
1 change: 0 additions & 1 deletion app/views/movies/_edit_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- form_for(@movie) do |f|
= f.error_messages
- field_set_tag "Movie Details" do
%ul
%li
Expand Down
4 changes: 2 additions & 2 deletions app/views/movies/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
= render :partial => "edit_form"

%ul#page_nav
%li= link_to 'Cancel', @movie
%li= link_to 'Back to list of movies', movies_path
%li= link_to "Cancel and back to #{@movie.name}", @movie
%li= link_to "Cancel and go Back to list of movies", movies_path
2 changes: 1 addition & 1 deletion app/views/movies/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
= render :partial => "edit_form"

%ul#page_nav
%li link_to 'Back to list of movies', movies_path
%li= link_to "Cancel and go back to list of movies", movies_path
59 changes: 5 additions & 54 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,60 +1,11 @@
Rottenpotatoes::Application.routes.draw do
resources :movies
ActionController::Routing::Routes.draw do |map|

# The priority is based upon order of creation:
# first created -> highest priority.
# create RESTful routes for the Movie resource.
map.resources :movies

# 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

# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => "welcome#index"
# The root of the site ('/') is an alias for 'list all movies'.
map.root :movies

# 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
1 change: 1 addition & 0 deletions db/migrate/20110909213200_create_movies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ def self.up
create_table :movies do |t|
t.string :title
t.string :rating
t.text :description
t.datetime :released_on

t.timestamps
Expand Down
239 changes: 0 additions & 239 deletions public/index.html

This file was deleted.

Loading

0 comments on commit 97bf97f

Please sign in to comment.