rostra 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,57 @@
|
|
1
|
+
module Rostra
|
2
|
+
module Base
|
3
|
+
class QuestionsController < ApplicationController
|
4
|
+
load_and_authorize_resource
|
5
|
+
|
6
|
+
def vote
|
7
|
+
rostra_user.vote_on(@question, params[:vote_direction])
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
format.html { redirect_to @question }
|
11
|
+
format.js
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def index
|
16
|
+
if params[:tag_search].present?
|
17
|
+
@questions = Question.tagged_with(params[:tag_search]).order('created_at desc')
|
18
|
+
else
|
19
|
+
@questions = Question.order('created_at desc')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def show
|
24
|
+
@answers = @question.answers
|
25
|
+
impressionist(@question) # increments page views
|
26
|
+
end
|
27
|
+
|
28
|
+
def new
|
29
|
+
end
|
30
|
+
|
31
|
+
def edit
|
32
|
+
end
|
33
|
+
|
34
|
+
def create
|
35
|
+
if @question.save
|
36
|
+
redirect_to questions_path, notice: 'Your question has been posted.'
|
37
|
+
else
|
38
|
+
render :new
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def update
|
43
|
+
if @question.update_attributes(params[:question])
|
44
|
+
redirect_to @question, notice: 'Question was successfully updated.'
|
45
|
+
else
|
46
|
+
render :edit
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def destroy
|
51
|
+
@question.destroy
|
52
|
+
redirect_to questions_url
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -1,54 +1,5 @@
|
|
1
1
|
module Rostra
|
2
|
-
class QuestionsController <
|
3
|
-
|
4
|
-
|
5
|
-
def vote
|
6
|
-
rostra_user.vote_on(@question, params[:vote_direction])
|
7
|
-
|
8
|
-
respond_to do |format|
|
9
|
-
format.html { redirect_to @question }
|
10
|
-
format.js
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def index
|
15
|
-
if params[:tag_search].present?
|
16
|
-
@questions = Question.tagged_with(params[:tag_search]).order('created_at desc')
|
17
|
-
else
|
18
|
-
@questions = Question.order('created_at desc')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def show
|
23
|
-
@answers = @question.answers
|
24
|
-
impressionist(@question) # increments page views
|
25
|
-
end
|
26
|
-
|
27
|
-
def new
|
28
|
-
end
|
29
|
-
|
30
|
-
def edit
|
31
|
-
end
|
32
|
-
|
33
|
-
def create
|
34
|
-
if @question.save
|
35
|
-
redirect_to questions_path, notice: 'Your question has been posted.'
|
36
|
-
else
|
37
|
-
render :new
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def update
|
42
|
-
if @question.update_attributes(params[:question])
|
43
|
-
redirect_to @question, notice: 'Question was successfully updated.'
|
44
|
-
else
|
45
|
-
render :edit
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def destroy
|
50
|
-
@question.destroy
|
51
|
-
redirect_to questions_url
|
52
|
-
end
|
2
|
+
class QuestionsController < Rostra::Base::QuestionsController
|
3
|
+
# Override existing actions here
|
53
4
|
end
|
54
5
|
end
|
data/lib/rostra/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rostra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.14
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Cory Schires
|
@@ -487,6 +487,7 @@ files:
|
|
487
487
|
- app/assets/stylesheets/rostra/typography.css
|
488
488
|
- app/controllers/rostra/answers_controller.rb
|
489
489
|
- app/controllers/rostra/application_controller.rb
|
490
|
+
- app/controllers/rostra/base/questions_controller.rb
|
490
491
|
- app/controllers/rostra/comments_controller.rb
|
491
492
|
- app/controllers/rostra/questions_controller.rb
|
492
493
|
- app/helpers/rostra/application_helper.rb
|