From 1eb2af7eb7d72497a81b259e0280bedca5b8b150 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 6 Nov 2011 21:33:46 -0500 Subject: [PATCH] change the homes controller to home and remove public index.html --- app/assets/images/rails.png | Bin 6646 -> 0 bytes app/assets/javascripts/.gitkeep | 0 app/assets/javascripts/items.js | 2 - app/assets/stylesheets/.gitkeep | 0 app/assets/stylesheets/items.css | 4 - app/assets/stylesheets/scaffold.css | 56 ---- app/assets/stylesheets/user.css.scss | 3 - app/controllers/homes_controller.rb | 83 ------ app/helpers/homes_helper.rb | 2 - app/views/homes/_form.html.haml | 10 - app/views/homes/edit.html.haml | 7 - app/views/homes/index.html.haml | 17 -- app/views/homes/new.html.haml | 5 - app/views/homes/show.html.haml | 6 - app/views/layouts/application.html.erb | 14 - app/views/layouts/application.html.haml | 21 -- .../20111107011726_devise_create_users.rb | 28 -- db/migrate/20111107013637_create_items.rb | 11 - public/index.html | 239 ------------------ 19 files changed, 508 deletions(-) delete mode 100644 app/assets/images/rails.png delete mode 100644 app/assets/javascripts/.gitkeep delete mode 100644 app/assets/javascripts/items.js delete mode 100644 app/assets/stylesheets/.gitkeep delete mode 100644 app/assets/stylesheets/items.css delete mode 100644 app/assets/stylesheets/scaffold.css delete mode 100644 app/assets/stylesheets/user.css.scss delete mode 100644 app/controllers/homes_controller.rb delete mode 100644 app/helpers/homes_helper.rb delete mode 100644 app/views/homes/_form.html.haml delete mode 100644 app/views/homes/edit.html.haml delete mode 100644 app/views/homes/index.html.haml delete mode 100644 app/views/homes/new.html.haml delete mode 100644 app/views/homes/show.html.haml delete mode 100644 app/views/layouts/application.html.erb delete mode 100644 app/views/layouts/application.html.haml delete mode 100644 db/migrate/20111107011726_devise_create_users.rb delete mode 100644 db/migrate/20111107013637_create_items.rb delete mode 100644 public/index.html diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png deleted file mode 100644 index d5edc04e65f555e3ba4dcdaad39dc352e75b575e..0000000000000000000000000000000000000000 GIT binary pat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(9F)f=Qn)(daVB7hZtcp^#LrEr1T1J zZSJ*lVyVVjhy)mkex9Whn=EinKDHe@KlfQI-Fl7M?-c~HnW0;C;+MbUY8?FToy;A+ zs&Nc7VZ=Of+e!G6s#+S5WBU)kgQq_I1@!uH74GJ-+O|%0HXm9Mqlvp|j%0`T>fr9^ zK;qo>XdwZW<>%tTA+<(1^6(>=-2N;hRgBnjvEjN;VbKMbFg--WrGy|XESoH1p|M4` z86(gC^vB4qScASZ&cdpT{~QDN-jC|GJ(RYoW1VW4!SSn- zhQds9&RBKn6M&GVK_Aayt(Hekbnw=tr>f z^o@v9_*iQO1*zeOrts9Q-$pc@!StS&kz$cF`s@pM`rmJXTP&h5G)A74!0e%ZJbl}( zssI|_!%~_hZFypv*S^JE5N&Kvmx7KiG<|fGMO=WrH+@Yhuj+KwiS#l4>@%2nl zS)mDikfmokO4q2A)hRVZBq2-5q&XC>%HOLkOYxZ66(s86?=0s4z5xbiOV)}L-&6b)h6(~CIaR#JNw~46+WBiU7IhB zq!NuR4!TsYnyBg>@G=Ib*cMq^k<}AMpCeYEf&dzfiGI-wOQ7hb+nA zkN7_){y&c3xC0 AQ~&?~ diff --git a/app/assets/javascripts/.gitkeep b/app/assets/javascripts/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/javascripts/items.js b/app/assets/javascripts/items.js deleted file mode 100644 index dee720f..0000000 --- a/app/assets/javascripts/items.js +++ /dev/null @@ -1,2 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/.gitkeep b/app/assets/stylesheets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/stylesheets/items.css b/app/assets/stylesheets/items.css deleted file mode 100644 index afad32d..0000000 --- a/app/assets/stylesheets/items.css +++ /dev/null @@ -1,4 +0,0 @@ -/* - Place all the styles related to the matching controller here. - They will automatically be included in application.css. -*/ diff --git a/app/assets/stylesheets/scaffold.css b/app/assets/stylesheets/scaffold.css deleted file mode 100644 index 1ae7000..0000000 --- a/app/assets/stylesheets/scaffold.css +++ /dev/null @@ -1,56 +0,0 @@ -body { background-color: #fff; color: #333; } - -body, p, ol, ul, td { - font-family: verdana, arial, helvetica, sans-serif; - font-size: 13px; - line-height: 18px; -} - -pre { - background-color: #eee; - padding: 10px; - font-size: 11px; -} - -a { color: #000; } -a:visited { color: #666; } -a:hover { color: #fff; background-color:#000; } - -div.field, div.actions { - margin-bottom: 10px; -} - -#notice { - color: green; -} - -.field_with_errors { - padding: 2px; - background-color: red; - display: table; -} - -#error_explanation { - width: 450px; - border: 2px solid red; - padding: 7px; - padding-bottom: 0; - margin-bottom: 20px; - background-color: #f0f0f0; -} - -#error_explanation h2 { - text-align: left; - font-weight: bold; - padding: 5px 5px 5px 15px; - font-size: 12px; - margin: -7px; - margin-bottom: 0px; - background-color: #c00; - color: #fff; -} - -#error_explanation ul li { - font-size: 12px; - list-style: square; -} diff --git a/app/assets/stylesheets/user.css.scss b/app/assets/stylesheets/user.css.scss deleted file mode 100644 index 7c5eca9..0000000 --- a/app/assets/stylesheets/user.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the user controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/homes_controller.rb b/app/controllers/homes_controller.rb deleted file mode 100644 index 6477e82..0000000 --- a/app/controllers/homes_controller.rb +++ /dev/null @@ -1,83 +0,0 @@ -class HomesController < ApplicationController - # GET /homes - # GET /homes.json - def index - @homes = Home.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @homes } - end - end - - # GET /homes/1 - # GET /homes/1.json - def show - @home = Home.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.json { render json: @home } - end - end - - # GET /homes/new - # GET /homes/new.json - def new - @home = Home.new - - respond_to do |format| - format.html # new.html.erb - format.json { render json: @home } - end - end - - # GET /homes/1/edit - def edit - @home = Home.find(params[:id]) - end - - # POST /homes - # POST /homes.json - def create - @home = Home.new(params[:home]) - - respond_to do |format| - if @home.save - format.html { redirect_to @home, notice: 'Home was successfully created.' } - format.json { render json: @home, status: :created, location: @home } - else - format.html { render action: "new" } - format.json { render json: @home.errors, status: :unprocessable_entity } - end - end - end - - # PUT /homes/1 - # PUT /homes/1.json - def update - @home = Home.find(params[:id]) - - respond_to do |format| - if @home.update_attributes(params[:home]) - format.html { redirect_to @home, notice: 'Home was successfully updated.' } - format.json { head :ok } - else - format.html { render action: "edit" } - format.json { render json: @home.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /homes/1 - # DELETE /homes/1.json - def destroy - @home = Home.find(params[:id]) - @home.destroy - - respond_to do |format| - format.html { redirect_to homes_url } - format.json { head :ok } - end - end -end diff --git a/app/helpers/homes_helper.rb b/app/helpers/homes_helper.rb deleted file mode 100644 index 2a8ce49..0000000 --- a/app/helpers/homes_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module HomesHelper -end diff --git a/app/views/homes/_form.html.haml b/app/views/homes/_form.html.haml deleted file mode 100644 index 408a221..0000000 --- a/app/views/homes/_form.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -= form_for @home do |f| - -if @home.errors.any? - #error_explanation - %h2= "#{pluralize(@home.errors.count, "error")} prohibited this home from being saved:" - %ul - - @home.errors.full_messages.each do |msg| - %li= msg - - .actions - = f.submit 'Save' diff --git a/app/views/homes/edit.html.haml b/app/views/homes/edit.html.haml deleted file mode 100644 index 94b90b9..0000000 --- a/app/views/homes/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%h1 Editing home - -= render 'form' - -= link_to 'Show', @home -\| -= link_to 'Back', homes_path diff --git a/app/views/homes/index.html.haml b/app/views/homes/index.html.haml deleted file mode 100644 index eeac685..0000000 --- a/app/views/homes/index.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -%h1 Listing homes - -%table - %tr - %th - %th - %th - - - @homes.each do |home| - %tr - %td= link_to 'Show', home - %td= link_to 'Edit', edit_home_path(home) - %td= link_to 'Destroy', home, :confirm => 'Are you sure?', :method => :delete - -%br - -= link_to 'New Home', new_home_path diff --git a/app/views/homes/new.html.haml b/app/views/homes/new.html.haml deleted file mode 100644 index 4fc06c2..0000000 --- a/app/views/homes/new.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%h1 New home - -= render 'form' - -= link_to 'Back', homes_path diff --git a/app/views/homes/show.html.haml b/app/views/homes/show.html.haml deleted file mode 100644 index 6c42b5f..0000000 --- a/app/views/homes/show.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%p#notice= notice - - -= link_to 'Edit', edit_home_path(@home) -\| -= link_to 'Back', homes_path diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index de6c5dc..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - RailsQuiz - <%= stylesheet_link_tag :all %> - <%= javascript_include_tag :defaults %> - <%= csrf_meta_tag %> - - - -<%= yield %> - - - diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml deleted file mode 100644 index 8a03ac2..0000000 --- a/app/views/layouts/application.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -!!! -%html - %head - %title T App - %meta{:charset => "utf-8"} - %meta{"http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1"} - %meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"} - = stylesheet_link_tag :application - = javascript_include_tag :application - = csrf_meta_tags - %body{:class => params[:controller]} - #container.container - %header - %nav - %ul.hmenu - = render 'shared/navigation' - - flash.each do |name, msg| - = content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String) - #main{:role => "main"} - = yield - %footer \ No newline at end of file diff --git a/db/migrate/20111107011726_devise_create_users.rb b/db/migrate/20111107011726_devise_create_users.rb deleted file mode 100644 index 3083e74..0000000 --- a/db/migrate/20111107011726_devise_create_users.rb +++ /dev/null @@ -1,28 +0,0 @@ -class DeviseCreateUsers < ActiveRecord::Migration - def self.up - create_table(:users) do |t| - t.database_authenticatable :null => false - t.recoverable - t.rememberable - t.trackable - - # t.encryptable - # t.confirmable - # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both - # t.token_authenticatable - - - t.timestamps - end - - add_index :users, :email, :unique => true - add_index :users, :reset_password_token, :unique => true - # add_index :users, :confirmation_token, :unique => true - # add_index :users, :unlock_token, :unique => true - # add_index :users, :authentication_token, :unique => true - end - - def self.down - drop_table :users - end -end diff --git a/db/migrate/20111107013637_create_items.rb b/db/migrate/20111107013637_create_items.rb deleted file mode 100644 index 80dd167..0000000 --- a/db/migrate/20111107013637_create_items.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateItems < ActiveRecord::Migration - def change - create_table :items do |t| - t.string :content - t.integer :bg_status - t.integer :priority - - t.timestamps - end - end -end diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 75d5edd..0000000 --- a/public/index.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - Ruby on Rails: Welcome aboard - - - - -
- - -
- - - - -
-

Getting started

-

Here’s how to get rolling:

- -
    -
  1. -

    Use rails generate to create your models and controllers

    -

    To see all available options, run it without parameters.

    -
  2. - -
  3. -

    Set up a default route and remove or rename this file

    -

    Routes are set up in config/routes.rb.

    -
  4. - -
  5. -

    Create your database

    -

    Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    -
  6. -
-
-
- - -
- -