Skip to content

Commit df8c666

Browse files
Jaymes Waters and Matt Gaugermathias
authored andcommitted
Whitespace cleanup
1 parent 924487e commit df8c666

19 files changed

Lines changed: 64 additions & 64 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
class AnswersController < InheritedController
22
load_and_authorize_resource
3-
3+
44
belongs_to :question
5-
5+
66
def create
77
@answer = Answer.create params[:answer]
88
@answer.question = @question
99
@answer.user = current_user
1010
create!(:notice => "Answer Posted!"){ question_url(params[:question_id]) }
1111
end
12-
13-
12+
13+
1414
end

app/controllers/inherited_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ def form_url
1818
resource.inspect
1919
rescue
2020
end
21-
# end of bug fix.
21+
# end of bug fix.
22+
2223

23-
2424
if ['new','create'].include? params[:action]
2525
@form_url = collection_path
2626
elsif
2727
@form_url = resource_path
2828
end
2929
end
30-
30+
3131
end

app/controllers/questions_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ class QuestionsController < InheritedController
44
def create
55
@question = Question.create params[:question]
66
@question.user = current_user
7-
create!(:notice => "Question Asked!"){ collection_url }
7+
create!(:notice => "Question Asked!") { collection_url }
88
end
9-
9+
1010
def show
1111
@answer = Answer.new
1212
show!
@@ -15,7 +15,7 @@ def show
1515
def update
1616
params[:question][:solution_id] != @question.solution_id ? update!(:notice => "Okay! We've selected that answer") : update!
1717
end
18-
18+
1919
def collection
2020
@questions ||= end_of_association_chain.newest_first.paginate(:page => params[:page])
2121
end

app/models/ability.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
class Ability
22
include CanCan::Ability
33

4-
def initialize(user)
4+
def initialize(user)
55
user ||= User.new
6-
6+
77
can :read, :all
8-
8+
99
unless user.new_record?
1010
can :create, [Question, Answer]
1111
can :manage, [Question, Answer], :user => user
1212
can :update, user
13-
end
14-
13+
end
14+
1515
# Define abilities for the passed in user here. For example:
1616
#
1717
# user ||= User.new # guest user (not logged in)

app/models/answer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ class Answer
22
include MongoMapper::Document
33

44
key :description, String
5-
5+
66
validates_presence_of :description
7-
7+
88
belongs_to :question
99
belongs_to :user
1010

app/views/answers/_list.html.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
%li.answer{:class => list.id == @question.solution_id && 'selected-answer'}
22
- if list.user
3-
.meta
3+
.meta
44
#{link_to list.user.username, ""} says
55
.description
66
!= RDiscount.new(list.description).to_html
7-
7+
88
.links
99
- if can? :update, list
1010
= link_to 'Edit', edit_question_answer_path(@question, list)
1111
- if can? :destroy, list
1212
= link_to 'Delete', question_answer_path(@question, list), :confirm => 'Are you sure?', :method => :delete
13-
13+
1414
- if can?(:update, @question) && (@question.solution_id != list.id)
1515
= simple_form_for(@question, :url => question_path(@question)) do |f|
1616
= f.hidden_field :solution_id, :value => list.id

app/views/answers/index.html.haml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
- content_for :title do
22
Answers
3-
3+
44
- content_for :links do
55
- if can? :create, Answer
66
= link_to "New answer", new_resource_path
7-
8-
%ul.answers
9-
= render :partial => "list", :collection => collection
7+
8+
%ul.answers
9+
= render :partial => "list", :collection => collection

app/views/layouts/application.html.haml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,33 @@
1313
%header.topbar
1414
.topbar-inner
1515
.container
16-
#logo
16+
#logo
1717
= link_to "Hackety Hack", root_path
1818
= render "shared/menu/main"
1919
= render "shared/menu/user"
20-
20+
2121
- sidebar = yield :sidebar
22-
22+
2323
#content-wrap{:class => @page_class}
2424
- if flash[:notice]
2525
.container.alert-message.success
2626
#{flash[:notice]}
2727
= link_to "x", "#", :class => "close"
28-
28+
2929
.container{:class => sidebar.empty? ? "one-column" : "two-column"}
3030
#content{:class => @content_class}
3131

3232
- title = yield :title
3333
- unless title.empty?
3434
%h1.title= title
35-
35+
3636
= yield
37-
37+
3838
- unless sidebar.empty?
3939
#sidebar
4040
= sidebar
4141

4242
%footer
43-
.container
43+
.container
4444
= render "shared/menu/footer"
45-
45+

app/views/questions/_list.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.meta
88
Asked by
99
%span.name= link_to list.user.username, ""
10-
10+
1111
%span.date= time_ago_in_words(list.created_at)
1212
ago
1313
.description= truncate(list.description, :length => 150)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
- content_for :title do
22
Questions
3-
3+
44
- content_for :sidebar do
55
- if can? :create, Question
66
= link_to "Ask a Question", new_resource_path, :class => "btn success"
77

88
%ul.questions
99
= render :partial => "list", :collection => collection
1010

11-
= will_paginate
11+
= will_paginate

0 commit comments

Comments
 (0)