Sha256: 4007c2fd1e6644e29b4b4f9a78ce555b32e1a3e0ef8a425e1177de9da8cf6068

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

require_dependency "forem/application_controller"

module Forem
  class TopicsController < ApplicationController
    before_filter :authenticate_forem_user!, :only => [:new, :create]
    def index
      @topics = Forem::Topic.all
    end
    def new
      @topic = Forem::Topic.new
      @topic.posts.build
    end
    def create
      params[:topic].merge!(:user => current_user)
      @topic = Forem::Topic.create(params[:topic])
      flash[:notice] = "Topic has been created!"
      redirect_to @topic
    end
    def show
      @topic = Forem::Topic.find(params[:id])
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
neifelheim-forem-0.0.2 app/controllers/forem/topics_controller.rb
neifelheim-forem-0.0.1 app/controllers/forem/topics_controller.rb