AutoCommit Mon Aug 10 13:03:04 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-10 13:03:04 +02:00
parent cb73bbfa43
commit 3835c0e773
6 changed files with 115 additions and 107 deletions

View File

@@ -2,7 +2,7 @@
<%= div_tag_for(choice) do %>
<%
if current_user.nil?
unless can?(:answer,choice.question)
t=choice.text
else
value=(current_user.id.nil?)? false : choice.answers.where(user_id: current_user.id).count>0
@@ -13,7 +13,7 @@ end
%>
<%= t %> <%= link_to fa_icon("pencil"), edit_survey_choice_path(choice) , class: "btn btn-link navbar-btn" , remote: true
<%= t %> <%= link_to fa_icon("pencil"), edit_survey_choice_path(choice) , class: "btn btn-link navbar-btn" , remote: true if can? :edit, choice
%>
<%= link_to fa_icon("trash"), survey_choice_path(choice) , class: "btn btn-link navbar-btn" , remote: true , method: :delete, data: { confirm: 'Are you sure?' } %>
<%= link_to fa_icon("trash"), survey_choice_path(choice) , class: "btn btn-link navbar-btn" , remote: true , method: :delete, data: { confirm: 'Are you sure?' } if can? :delete,choice %>
<% end %>