Permalink
Browse files

Intermediate response commit.

  • Loading branch information...
mark-d-holmberg committed Apr 12, 2012
1 parent 8afaac7 commit 0fb26ded9ef34288e5bc1886689a0fb9d3449cd1
@@ -206,11 +206,10 @@ section {
}
&#result {
border: 1px solid $border_color_standard;
- border-top: none;
padding: 0.5em;
margin: 0;
position: absolute;
- top: 2.1em;
+ top: 5em;
right: 0.1em;
width: 67%;
z-index: 1;
@@ -1,3 +1,16 @@
// Place all the styles related to the Pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
+@import "sass_custom.css.scss";
+section {
+ &#surveys_list {
+ border: 1px solid $border_color_standard;
+ border-top: none;
+ position: absolute;
+ top: 2.1em;
+ right: 0.1em;
+ width: 67%;
+ padding: 0.5em;
+ z-index: 999999;
+ }
+}
@@ -1,12 +1,12 @@
class ResponsesController < ApplicationController
load_and_authorize_resource
def index
- @responses = current_user.responses
- authorize! :index, Response
+ @student = User.find(params[:user_id])
+ authorize! :read, @student, :id => @student.id
+ authorize! :index, Response, :user_id => current_user.id
end
def show
- @response = current_user.responses.find(params[:id])
end
def new
View
@@ -10,10 +10,11 @@ def initialize(user)
can :update_my_details, User, :id => user.id
can :edit_password, User, :id => user.id
can :update_password, User, :id => user.id
- can :index, Response, :user_id => user.id
can :take, :survey
can :create, :survey
can :show, :survey
+ can :index, Response, :user_id => user.id
+ can :show, Response, :user_id => user.id
cannot :assign_roles, User
cannot :destroy, User
cannot :list, :students
@@ -1 +1,2 @@
<%= render "shared/user_search/listing" %>
+<%= render "shared/survey_list" %>
@@ -1,4 +1,5 @@
<%= div_for response do %>
+ Response ID: <%= label_tag :response_id, response.id %><br />
Answer ID: <%= label_tag :answer_id, response.answer_id %><br />
User ID: <%= label_tag :user_id, response.user_id %><br />
Question ID: <%= label_tag :question_id, response.question_id %><br />
@@ -0,0 +1 @@
+show
@@ -0,0 +1,5 @@
+<section id="surveys_list">
+ <% @surveys.each do |survey| %>
+ <%= link_to survey.name, survey_path(survey.id) %> |
+ <% end %>
+</section>
@@ -1,6 +1,6 @@
<div id="show-student-individual">
<% @student.each do |student| %>
<%= student.name.inspect %><br />
- <%= student.email.inspect %>
+ <%= student.email.inspect %><br />
<% end %>
</div>

0 comments on commit 0fb26de

Please sign in to comment.