AutoCommit Sam Aug 1 14:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-01 14:03:01 +02:00
parent fb99d55734
commit cc764f68af
11 changed files with 183 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ if current_user.nil?
else
value=(current_user.id.nil?)? false : choice.answers.where(user_id: current_user.id).count>0
cstyle=(value) ? "true" :"false"
t= link_to(raw("" + choice.html+ (( choice.picture.nil?) ? "":image_tag(choice.picture.thumb.url))), answer_survey_question_path(choice.question, params: {survey_question: {selected: [choice.id]}}),class: "choice-"+cstyle )
t= link_to(raw("" + choice.html+ (( choice.picture.nil? || choice.picture.to_s.empty?) ? "":image_tag(choice.picture.thumb.url))), answer_survey_question_path(choice.question, params: {survey_question: {selected: [choice.id]}}),class: "choice-"+cstyle )
end
%>

View File

@@ -5,9 +5,7 @@
<%= f.input :icon, :input_html=>{:id=>"iconfield"},:as=>:hidden %>
<label>Bild</label>
<%= image_tag(@choice.picture.thumb.url) unless @choice.picture.nil? %>
<%= f.file_field :picture %>
<%= f.input :picture, as: :uploader %>
<%= f.hidden_field :picture_cache %>
<% end %>