Sha256: eb98ca7509284a4aeb8075702c93a0db07dae76965df70e4ee7c63588df9875e

Contents?: true

Size: 807 Bytes

Versions: 21

Compression:

Stored size: 807 Bytes

Contents

class PostsController < ApplicationController
  # GET /posts/1
  # GET /posts/1.xml
  def show
    @post = Post.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @post }
    end
  end

  # POST /posts
  # POST /posts.xml
  def create
    @sections = Object.new
    # Have this line raise an exception
    @post = Post.nw(params[:post])

    respond_to do |format|
      if @post.save
        format.html { redirect_to(post_path(@post), :notice => 'Post was successfully created.') }
        format.xml  { render :xml => @post, :status => :created, :location => @post }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @post.errors, :status => :unprocessable_entity }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
exception_notification-4.3.0 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.2.2 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.2.1 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.2.0 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.2.0.rc1 test/dummy/app/controllers/posts_controller.rb
exception_notification_more_info-1.0.1 test/dummy/app/controllers/posts_controller.rb
exception_notification_more_info-1.0.0 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.1.4 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.1.3 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.1.2 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.1.1 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.1.0 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.1.0.rc2 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.1.0.rc1 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.0.1 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.0.0 test/dummy/app/controllers/posts_controller.rb
exception_notification-4.0.0.rc1 test/dummy/app/controllers/posts_controller.rb
exception_notification-3.0.1 test/dummy/app/controllers/posts_controller.rb
exception_notification-3.0.1.rc1 test/dummy/app/controllers/posts_controller.rb
exception_notification-3.0.0 test/dummy/app/controllers/posts_controller.rb