display_all

This commit is contained in:
nilsding 2014-12-12 18:54:17 +01:00
parent 130cbb27ce
commit 54ec828e5b
2 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,6 @@
class AnswerController < ApplicationController
def show
@answer = Answer.find(params[:id])
@display_all = true
end
end

View File

@ -20,13 +20,17 @@
%p.answerbox--question-text
= a.question.content
.panel-body
%p= a.content[0..255]
- if a.content.length > 255
[...]
%br/
Answer too long to display.
%a{href: show_user_answer_path(a.user.screen_name, a.id)}
Read the entire answer
%p
- if @display_all.nil?
= a.content[0..255]
- if a.content.length > 255
[...]
%br/
Answer too long to display.
%a{href: show_user_answer_path(a.user.screen_name, a.id)}
Read the entire answer
- else
= a.content
- if @user.nil?
.row
.col-md-6.col-sm-4.col-xs-7.text-left.text-muted