Sha256: 80c51c605b908c932ff27decb015265f00054531bb308b1827ed8383667460b1

Contents?: true

Size: 530 Bytes

Versions: 11

Compression:

Stored size: 530 Bytes

Contents

module Rostra
  class CommentsController < ApplicationController
    load_and_authorize_resource

    before_filter :fetch_question

    def create

      if @comment.save
        redirect_to @question
      end
    end

    def update
      @comment.update_attributes(:comment => params[:value])
      render :text => @comment.comment
    end

    def destroy
      @comment.destroy
      redirect_to @question
    end

    private

    def fetch_question
      @question = Question.find(params[:question_id])
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rostra-0.0.14 app/controllers/rostra/comments_controller.rb
rostra-0.0.13 app/controllers/rostra/comments_controller.rb
rostra-0.0.12 app/controllers/rostra/comments_controller.rb
rostra-0.0.11 app/controllers/rostra/comments_controller.rb
rostra-0.0.10 app/controllers/rostra/comments_controller.rb
rostra-0.0.9 app/controllers/rostra/comments_controller.rb
rostra-0.0.8 app/controllers/rostra/comments_controller.rb
rostra-0.0.7 app/controllers/rostra/comments_controller.rb
rostra-0.0.6 app/controllers/rostra/comments_controller.rb
rostra-0.0.5 app/controllers/rostra/comments_controller.rb
rostra-0.0.4 app/controllers/rostra/comments_controller.rb