Sha256: f77667a2453638e9f0d692f0a091dfa7b631a8c176d1a462e31d048bf50371df

Contents?: true

Size: 585 Bytes

Versions: 1

Compression:

Stored size: 585 Bytes

Contents

module Hitchens
  class PostsController < ApplicationController
    def index
      @posts = @posts.page(params[:page]).per_page(Hitchens.posts_per_page)
      @posts = PostDecorator.decorate @posts
    end

    def show
      @post = PostDecorator.decorate @post
    end

    def create
      if @post.save
        redirect_to posts_path
      else
        render 'new'
      end
    end
    def update
      if @post.update_attributes params[:post]
        redirect_to posts_path
      else
        render 'edit'
      end
    end

    def new
    end
    def edit
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hitchens-0.0.1 app/controllers/hitchens/posts_controller.rb