AutoCommit Mit Aug 5 09:03:03 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-05 09:03:03 +02:00
parent 9b1c35f499
commit 3a4888c9a4
3 changed files with 4 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ class Survey::Question < ActiveRecord::Base
has_many :choices, dependent: :destroy has_many :choices, dependent: :destroy
has_many :answers, through: :choices has_many :answers, through: :choices
include IsCommentable include IsCommentable
FLAG_ICONS={"delete" => "fa fa-trash"}
scope :templates, ->{ where(flag_template:true)} scope :templates, ->{ where(flag_template:true)}
def add_yesno_choices def add_yesno_choices

View File

@@ -6,6 +6,7 @@
<div class="contentbox" id ="<%= divid_for(question) %>" style=""> <div class="contentbox" id ="<%= divid_for(question) %>" style="">
<div > <div >
<b><%= question.title%></b> <%=question.text%><%= link_to fa_icon("pencil"), edit_survey_question_path(question) , class: "btn btn-link navbar-btn" , remote: true%> <b><%= question.title%></b> <%=question.text%><%= link_to fa_icon("pencil"), edit_survey_question_path(question) , class: "btn btn-link navbar-btn" , remote: true%>
<%= flag_link(question, "delete")%>
<ul class="choice-list"> <ul class="choice-list">
<% question.choices.each do |c| %> <% question.choices.each do |c| %>

View File

@@ -15,6 +15,8 @@
member do member do
get :answer get :answer
put :answer put :answer
get 'flag'
end end
end end
resources :choices resources :choices