diff options
author | Xavier Noria <fxn@hashref.com> | 2012-03-17 08:32:49 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-03-17 08:32:49 -0700 |
commit | 6d87cd028b32570973450424db164e5405a0ee13 (patch) | |
tree | 38008699f54532c6ba446ec806ccc33ad26b10fd /railties/guides/code/getting_started/app/controllers | |
parent | 9d06b49913dd2a2254d87c7af1af9f1e4d7f64ec (diff) | |
download | rails-6d87cd028b32570973450424db164e5405a0ee13.tar.gz rails-6d87cd028b32570973450424db164e5405a0ee13.tar.bz2 rails-6d87cd028b32570973450424db164e5405a0ee13.zip |
moves the guides up to the root directory
Diffstat (limited to 'railties/guides/code/getting_started/app/controllers')
4 files changed, 0 insertions, 108 deletions
diff --git a/railties/guides/code/getting_started/app/controllers/application_controller.rb b/railties/guides/code/getting_started/app/controllers/application_controller.rb deleted file mode 100644 index e8065d9505..0000000000 --- a/railties/guides/code/getting_started/app/controllers/application_controller.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ApplicationController < ActionController::Base - protect_from_forgery -end diff --git a/railties/guides/code/getting_started/app/controllers/comments_controller.rb b/railties/guides/code/getting_started/app/controllers/comments_controller.rb deleted file mode 100644 index 7447fd078b..0000000000 --- a/railties/guides/code/getting_started/app/controllers/comments_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CommentsController < ApplicationController - http_basic_authenticate_with :name => "dhh", :password => "secret", :only => :destroy - def create - @post = Post.find(params[:post_id]) - @comment = @post.comments.create(params[:comment]) - redirect_to post_path(@post) - end - - def destroy - @post = Post.find(params[:post_id]) - @comment = @post.comments.find(params[:id]) - @comment.destroy - redirect_to post_path(@post) - end - -end diff --git a/railties/guides/code/getting_started/app/controllers/home_controller.rb b/railties/guides/code/getting_started/app/controllers/home_controller.rb deleted file mode 100644 index 6cc31c1ca3..0000000000 --- a/railties/guides/code/getting_started/app/controllers/home_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class HomeController < ApplicationController - def index - end - -end diff --git a/railties/guides/code/getting_started/app/controllers/posts_controller.rb b/railties/guides/code/getting_started/app/controllers/posts_controller.rb deleted file mode 100644 index 1581d4eb16..0000000000 --- a/railties/guides/code/getting_started/app/controllers/posts_controller.rb +++ /dev/null @@ -1,84 +0,0 @@ -class PostsController < ApplicationController - http_basic_authenticate_with :name => "dhh", :password => "secret", :except => :index - # GET /posts - # GET /posts.json - def index - @posts = Post.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @posts } - end - end - - # GET /posts/1 - # GET /posts/1.json - def show - @post = Post.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.json { render json: @post } - end - end - - # GET /posts/new - # GET /posts/new.json - def new - @post = Post.new - - respond_to do |format| - format.html # new.html.erb - format.json { render json: @post } - end - end - - # GET /posts/1/edit - def edit - @post = Post.find(params[:id]) - end - - # POST /posts - # POST /posts.json - def create - @post = Post.new(params[:post]) - - respond_to do |format| - if @post.save - format.html { redirect_to @post, notice: 'Post was successfully created.' } - format.json { render json: @post, status: :created, location: @post } - else - format.html { render action: "new" } - format.json { render json: @post.errors, status: :unprocessable_entity } - end - end - end - - # PUT /posts/1 - # PUT /posts/1.json - def update - @post = Post.find(params[:id]) - - respond_to do |format| - if @post.update_attributes(params[:post]) - format.html { redirect_to @post, notice: 'Post was successfully updated.' } - format.json { head :no_content } - else - format.html { render action: "edit" } - format.json { render json: @post.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /posts/1 - # DELETE /posts/1.json - def destroy - @post = Post.find(params[:id]) - @post.destroy - - respond_to do |format| - format.html { redirect_to posts_url } - format.json { head :no_content } - end - end -end |