Skip to content

Instantly share code, notes, and snippets.

class PostsController < ApplicationController
# GET /posts
# GET /posts.json
before_filter :authenticate_user!, only: [:new, :create, :edit, :destroy]
def index
if params[:options_for_active] == 'Show All'
@posts = Post.recent
.search_title_body(params[:search_by_title])