Sha256: dfce2f97092b0b149621e318f46e0c1ef0da90f1ef1859a958ebfb949b36750e
Contents?: true
Size: 376 Bytes
Versions: 5
Compression:
Stored size: 376 Bytes
Contents
class PostsController < ApplicationController def index @posts = Post.all end def show @post = Post.find(params[:id]) if @post.heir.is_a?(BlogPost) redirect_to blog_post_url(@post.heir) elsif @post.heir.is_a?(ImagePost) redirect_to image_post_url(@post.heir) else render :text => "Unknown post-type" end end end
Version data entries
5 entries across 5 versions & 1 rubygems