Sha256: c4097699760f27ba3d635f17700d4ad0c59dc7f78bdaf5eaee7ab0cdb3fd6c0f

Contents?: true

Size: 277 Bytes

Versions: 9

Compression:

Stored size: 277 Bytes

Contents

class PostsController < ApplicationController

	def index

		@posts = Post.all
      
		respond_to do |format|
			format.json { render_json posts: @posts }
		end

	end

	def error
		respond_to do |format|
			format.json { render_api_error('Deliberate Error') }
		end
	end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
api_versioning-0.0.9 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.8 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.7 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.6 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.5 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.4 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.3 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.2 test/dummy/app/controllers/posts_controller.rb
api_versioning-0.0.1 test/dummy/app/controllers/posts_controller.rb