Sha256: 1ec77a3718d7d3d68a5f5a11b784e77038a8aed1f41055d3d259f7f757ee6c0c

Contents?: true

Size: 685 Bytes

Versions: 22

Compression:

Stored size: 685 Bytes

Contents

class PostsController < ApplicationController
  before_filter :authenticate_user!

  expose(:posts) { Post.all }
  expose(:post)
  
  def index
  end

  def admin
  end

  def guest
  end

  def admin_account
  end

  def show
  end

  def new
  end

  def create
    if post.save
      redirect_to post, :notice => "Successfully created post."
    else
      render :new
    end
  end

  def edit
  end
  
  def update
    if post.update_attributes(params[:post])
      redirect_to post, :notice => "Successfully updated post."
    else
      render :edit
    end
  end
  
  def destroy
    post.destroy
    redirect_to posts_url, :notice => "Successfully destroyed post."
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.9.4.6 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.9.4.5 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.9.4.3 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.9.4.2 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.9.4.1 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.9.4 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.9.3.2 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.9.5 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.9.4 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.9.3 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.9.2 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.9.1 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.9 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.8.1 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.8 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.7 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.6.2 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.6.1 spec/devise-dummy/app/controllers/posts_controller.rb
cantango-0.8.6 spec/devise-dummy/app/controllers/posts_controller.rb