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