Sha256: 3afddc40ebe46b0ebd564c304df45d785a4c8b3f5eff377af46c21f9ade8ff88

Contents?: true

Size: 1.4 KB

Versions: 8

Compression:

Stored size: 1.4 KB

Contents

class NoteeController < ApplicationController

  before_action :set_meta_info, except: [:show]

  # GET "/"
  def index
    @posts = notees
    @notee_title = 'Post Lists'
    render :action => 'posts'
  end

  # GET "/:id_or_slug"
  def show
    redirect_to root_path if params[:id_or_slug].nil?
    @post = notee(params[:id_or_slug])
    @notee_meta = notee_set_meta_by_post(@post)
  end

  # GET "/categories"
  def categories
    @categories = notee_categories
  end

  # GET "/categories/:name_or_slug"
  def category_posts
    @posts = category_notees(params[:name_or_slug])
    @notee_title = 'Category: ' + params[:name_or_slug]
    render :action => 'posts'
  end

  # GET "/archives"
  def archives
    @archives = notee_archives
  end

  # GET "/archives/:year"
  # GET "/archives/:year/:month"
  def archive_posts
    @posts = archive_notees(params[:year], params[:month].present? ? params[:month] : nil)
    @notee_title = 'Archive: ' + params[:year] + (params[:month].present? ? "/" + params[:month].to_s : "")
    render :action => 'posts'
  end

  # GET "/writers"
  def writers
    @writers = notee_writers
  end

  # GET "/writers/:name_or_id"
  def writer_posts
    @posts = writer_notees(params[:name_or_id])
    @notee_title = 'Writer: ' + params[:name_or_id]
    render :action => 'posts'
  end

  # GET "/about"
  def about
  end

  private
  def set_meta_info
    @notee_meta = Notee.blog_meta
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
notee-1.0.7 lib/tasks/controllers/notee_controller.rb
notee-1.0.6 lib/tasks/controllers/notee_controller.rb
notee-1.0.5 lib/tasks/controllers/notee_controller.rb
notee-1.0.4 lib/tasks/controllers/notee_controller.rb
notee-1.0.3 lib/tasks/controllers/notee_controller.rb
notee-1.0.2 lib/tasks/controllers/notee_controller.rb
notee-1.0.1 lib/tasks/controllers/notee_controller.rb
notee-1.0.0 lib/tasks/controllers/notee_controller.rb