Sha256: dec6adba487c86cd4b43a199dc088f590d967a6aa29073896b23cc9f13b53c3a
Contents?: true
Size: 1.09 KB
Versions: 1
Compression:
Stored size: 1.09 KB
Contents
module Rostra class QuestionsController < ApplicationController load_and_authorize_resource def vote rostra_user.vote_on(@question, params[:vote_direction]) respond_to do |format| format.html { redirect_to @question } format.js end end def index if params[:tag_search].present? @questions = Question.tagged_with(params[:tag_search]).order('created_at desc') else @questions = Question.order('created_at desc') end end def show @answers = @question.answers impressionist(@question) # increments page views end def new end def edit end def create if @question.save redirect_to questions_path, notice: 'Your question has been posted.' else render :new end end def update if @question.update_attributes(params[:question]) redirect_to @question, notice: 'Question was successfully updated.' else render :edit end end def destroy @question.destroy redirect_to questions_url end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rostra-0.0.13 | app/controllers/rostra/questions_controller.rb |