Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mdobrota
committed
Feb 5, 2012
1 parent
aa20a78
commit 41ae8f3
Showing
30 changed files
with
194 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class ReadingSpeedTestsController < ApplicationController | ||
def new | ||
@reading_speed_test = ReadingSpeedTest.setup_for(current_user) | ||
end | ||
|
||
def create | ||
end | ||
|
||
def show | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
class Content < ActiveRecord::Base | ||
|
||
class << self | ||
def for_reading_speed_test | ||
first | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class ReadingSpeedTest < ActiveRecord::Base | ||
belongs_to :user | ||
belongs_to :content | ||
|
||
class << self | ||
def setup_for(test_taker) | ||
new( | ||
:user => test_taker, | ||
:content => Content.for_reading_speed_test | ||
) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
= form_for(@content) do |f| | ||
- if @content.errors.any? | ||
#error_explanation | ||
%h2 | ||
= pluralize(@content.errors.count, "error") | ||
prohibited this content from being saved: | ||
%ul | ||
- @content.errors.full_messages.each do |msg| | ||
%li= msg | ||
.field | ||
= f.label :body | ||
%br/ | ||
= f.text_area :body | ||
.field | ||
= f.label :source_name | ||
%br/ | ||
= f.text_field :source_name | ||
.field | ||
= f.label :source_link | ||
%br/ | ||
= f.text_field :source_link | ||
.actions | ||
= f.submit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%h1 Editing content | ||
= render 'form' | ||
= link_to 'Show', @content | ||
| | ||
\#{link_to 'Back', contents_path} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%h1 Listing contents | ||
%table | ||
%tr | ||
%th Body | ||
%th Source name | ||
%th Source link | ||
%th | ||
%th | ||
%th | ||
- @contents.each do |content| | ||
%tr | ||
%td= content.body | ||
%td= content.source_name | ||
%td= content.source_link | ||
%td= link_to 'Show', content | ||
%td= link_to 'Edit', edit_content_path(content) | ||
%td= link_to 'Destroy', content, confirm: 'Are you sure?', method: :delete | ||
%br/ | ||
= link_to 'New Content', new_content_path |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%h1 New content | ||
= render 'form' | ||
= link_to 'Back', contents_path |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%p | ||
%b Body: | ||
= @content.body | ||
%p | ||
%b Source name: | ||
= @content.source_name | ||
%p | ||
%b Source link: | ||
= @content.source_link | ||
= link_to 'Edit', edit_content_path(@content) | ||
| | ||
\#{link_to 'Back', contents_path} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
!!! | ||
%html | ||
%head | ||
%title SpeedReading | ||
= stylesheet_link_tag "application", :media => "all" | ||
= javascript_include_tag "application" | ||
= csrf_meta_tags | ||
%body | ||
%p= user_header | ||
%p.notice= notice | ||
%p.alert= alert | ||
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This test will measure your reading speed. Click the start button when you are ready and done when you are finished reading. | ||
%button#start_reading Start | ||
#content | ||
= @reading_speed_test.content.body | ||
%button#finished_reading Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class CreateReadingSpeedTests < ActiveRecord::Migration | ||
def change | ||
create_table :reading_speed_tests do |t| | ||
t.integer :content_id | ||
t.integer :user_id | ||
t.integer :wpm | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :reading_speed_tests, :content_id | ||
add_index :reading_speed_tests, :user_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
public/assets/application-1c9609bc58b1e77c196de29021583379.css.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
public/assets/application-28647733cd84612bf5e3fa1139aa7f16.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
public/assets/jquery-ui.min-8b9c16ed13b920aebcfef3197711f61b.js.gz
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
public/assets/jquery.min-e3cda086d77f5617dc07d5ee81cee7b2.js.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
content_id: 1 | ||
user_id: 1 | ||
wpm: 1 | ||
|
||
two: | ||
content_id: 1 | ||
user_id: 1 | ||
wpm: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'test_helper' | ||
|
||
class ReadingSpeedTestTest < ActiveSupport::TestCase | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
end |