Sha256: 8d1034fba89eb0ccc4c976d00f09ff9f849b0642cc327101c6f50e8546da0843

Contents?: true

Size: 401 Bytes

Versions: 2

Compression:

Stored size: 401 Bytes

Contents

class Admin::PostsController < ApplicationController
  # Use fake post for controller as I don't want active record to mingle here.
  Post = Struct.new(:title)

  def index
    @posts = [
      Post.new('First'),
      Post.new('Second'),
    ]
    respond_to do |format|
      format.html { render }
      format.json { render :json => @posts }
    end
  end

  def new
    head :forbidden
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nunes-0.4.0 test/rails_app/app/controllers/admin/posts_controller.rb
nunes-0.3.1 test/rails_app/app/controllers/admin/posts_controller.rb