Sha256: f975f5fe0c786674609404bb9c13ce0a800ce812d5114b7834f61dc4f89de73d

Contents?: true

Size: 635 Bytes

Versions: 2

Compression:

Stored size: 635 Bytes

Contents

require_dependency "plotline/application_controller"

module Plotline
  class EntriesController < ApplicationController
    before_action :set_entry, only: [:show, :edit, :update, :destroy, :preview]

    def index
      @entries = Entry.where(type: content_class)
    end

    def show
    end

    def destroy
      @entry.destroy
      redirect_to content_entries_path, notice: 'Entry was successfully destroyed.'
    end

    private

    def set_entry
      @entry = Entry.find(params[:id])
    end

    def content_class
      @content_class ||= params[:content_class].classify
    end
    helper_method :content_class
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plotline-0.1.1 app/controllers/plotline/entries_controller.rb
plotline-0.1.0 app/controllers/plotline/entries_controller.rb