Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ba07d64
baseline met
ashtn Mar 21, 2017
0528f64
Wave 1 complete
ashtn Mar 21, 2017
1fe2237
added controller action show for tasks
ashtn Mar 21, 2017
6bf5963
added GET /new and POST /new request response cycle
ashtn Mar 22, 2017
4988f7a
update the task list to link to a action for each individual task
ashtn Mar 22, 2017
adf675c
add new column to schema table, updated relavent response cycle
ashtn Mar 23, 2017
6953a45
added edit link to show page, created edit route, edit action
ashtn Mar 24, 2017
eae7f5c
add edit from, and redirect to show page. Added link to all tasks in …
ashtn Mar 24, 2017
edf039e
added home link to application.rb and removed links to home from each…
ashtn Mar 24, 2017
94ba327
Ask the user to confirm that they definitely want to delete the task
ashtn Mar 24, 2017
f91c779
added partial form file
ashtn Mar 24, 2017
c3e1ac2
added form contents to _form file
ashtn Mar 24, 2017
4bbb5ee
rendered partial from in edit view template
ashtn Mar 24, 2017
93fd0d7
rendered partial form in new.html, fixed submit button on edit.html.erb
ashtn Mar 24, 2017
f89c819
added data:confrim to delete taks link
ashtn Mar 24, 2017
00d11a8
fixed delete routing bug
ashtn Mar 24, 2017
b3a0b2a
added link to 'all tasks' in application.html
ashtn Mar 25, 2017
c009d8b
added complete column to schema
ashtn Mar 25, 2017
242731e
Added task complete but & fixed bugs
ashtn Mar 25, 2017
28f1985
added wave for select option to model and from
ashtn Mar 25, 2017
6b445c9
added wave4 to select option in model and form
ashtn Mar 25, 2017
2898d8a
added partial for completed date information with method to condition…
ashtn Mar 26, 2017
c54a453
fixed completed button bug on show task page
ashtn Mar 27, 2017
6d5e919
final task list without css
ashtn Mar 27, 2017
6acc0e9
very weird merge error happened
ashtn Mar 27, 2017
f78b9e5
back to normal, hopefully
ashtn Mar 27, 2017
113d8c1
branch practice
ashtn Apr 5, 2017
1597474
README.md
ashtn Apr 5, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
source 'https://rubygems.org'

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end

group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]



# custom gems

gem 'emoji'
178 changes: 178 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.2)
actionpack (= 5.0.2)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.2)
actionview (= 5.0.2)
activesupport (= 5.0.2)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.2)
activesupport (= 5.0.2)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.2)
activesupport (= 5.0.2)
globalid (>= 0.3.6)
activemodel (5.0.2)
activesupport (= 5.0.2)
activerecord (5.0.2)
activemodel (= 5.0.2)
activesupport (= 5.0.2)
arel (~> 7.0)
activesupport (5.0.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
builder (3.2.3)
byebug (9.0.6)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
debug_inspector (0.0.2)
emoji (1.0.7)
json
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.18)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.8.1)
jbuilder (2.6.3)
activesupport (>= 3.0.0, < 5.2)
multi_json (~> 1.2)
jquery-rails (4.2.2)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.0.2)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.1)
multi_json (1.12.1)
nio4r (2.0.0)
nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
puma (3.8.2)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.2)
actioncable (= 5.0.2)
actionmailer (= 5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
activemodel (= 5.0.2)
activerecord (= 5.0.2)
activesupport (= 5.0.2)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.2)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.2)
actionpack (= 5.0.2)
activesupport (= 5.0.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
sass (3.4.23)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
spring (2.0.1)
activesupport (>= 4.2)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.7)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.1.9)
execjs (>= 0.3.0, < 3)
web-console (3.4.0)
actionview (>= 5.0)
activemodel (>= 5.0)
debug_inspector
railties (>= 5.0)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)

PLATFORMS
ruby

DEPENDENCIES
byebug
coffee-rails (~> 4.2)
emoji
jbuilder (~> 2.5)
jquery-rails
listen (~> 3.0.5)
puma (~> 3.0)
rails (~> 5.0.2)
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)

BUNDLED WITH
1.14.6
62 changes: 29 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,60 @@ Practice all aspects of Rails development.

## Baseline
In this baseline, you'll create a new Rails application and get started with two of the major components: route, controller and view.
**-** Fork and clone this repository to your computer
**-** Create a new Rails application using `rails new .`
**-** create a `Tasks` controller
**-** create a route to view the task `index` page
**-** create a controller action for the task `index` page which contains an array of hard-coded tasks
**-** create an ERB view to display the tasks from the controller action

- Fork and clone this repository to your computer
- Create a new Rails application using `rails new .`
- create a `Tasks` controller
- create a route to view the task `index` page
- create a controller action for the task `index` page which contains an array of hard-coded tasks
- create an ERB view to display the tasks from the controller action

<!--
## Wave 1
This wave is where we introduce ActiveRecord to create a model. We use the model to persist our data.

1. create a migration which will create a new `Task` model
- create the database schema and tables by running the `rails db:migrate` command
- the `Task` model should include _at least_ a name, a description and a completion date
- create at least 2 `Task` model instances using the `rails console`
**-** create the database schema and tables by running the `rails db:migrate` command
**-** the `Task` model should include _at least_ a name, a description and a completion date
**-** create at least 2 `Task` model instances using the `rails console`
1. update the controller's `index` action you created to retrieve and show `all` Task objects from the database
- you may need to update the view as well to use the model fields rather than the hard-coded data
-->
**-** you may need to update the view as well to use the model fields rather than the hard-coded data



<!--
## Wave 2
In this wave, we will expand the actions we support and introduce forms for user interactivity and persistence.

1. add support to `show` each task
- update the task list to link to a `show` action for each individual task
- create a route
- create a controller action
- create an ERB view
**-** update the task list to link to a `show` action for each individual task
**-** create a route
**-** create a controller action
**-** create an ERB view
1. Create a new task:
- update the task list to have a link to add a new task
- this will give the user a new page with a **form** with the appropriate task fields
- the site should take the user back to the task list after the new task is added
-->
**-** update the task list to have a link to add a new task
**-** this will give the user a new page with a **form** with the appropriate task fields
**-** the site should take the user back to the task list after the new task is added

<!--
## Wave 3
In this wave we will extend the interactivity with users, allowing them to edit existing tasks.

1. Edit a task
- update each task's show page to include an edit link
- this will give the user a new page with a **form** that is pre-populated with the data about that task
- the site should take the user back to the task's show page after the task is updated
**-** update each task's show page to include an edit link
**-** this will give the user a new page with a **form** that is pre-populated with the data about that task
**-** the site should take the user back to the task's show page after the task is updated

1. **Optional**
- DRY up your code by reusing the view code from the `new` functionality
**-** DRY up your code by reusing the view code from the `new` functionality
- Hint: Rendering _partials_ in Rails
-->

<!--

## Wave 4
In this wave, we will add the ability to delete tasks. We will also add the ability for a user to mark a task complete.

1. Delete a task
On the task list, add a button or link for each task that will, once clicked:
1. Ask the user to confirm that they definitely want to delete the task.
1. Delete the task from the database and redirect the user back to the list of remaining tasks
**1.** Ask the user to confirm that they definitely want to delete the task.
**1.** Delete the task from the database and redirect the user back to the list of remaining tasks
1. Mark a task complete
- Add a button to the list of tasks on the home page that, when clicked, will mark a task complete
- Update the database with the task's completed date
-->
**-** Add a button to the list of tasks on the home page that, when clicked, will mark a task complete
**-** Update the database with the task's completed date

6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative 'config/application'

Rails.application.load_tasks
3 changes: 3 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
Empty file added app/assets/images/.keep
Empty file.
16 changes: 16 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
13 changes: 13 additions & 0 deletions app/assets/javascripts/cable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the rails generate channel command.
//
//= require action_cable
//= require_self
//= require_tree ./channels

(function() {
this.App || (this.App = {});

App.cable = ActionCable.createConsumer();

}).call(this);
Empty file.
3 changes: 3 additions & 0 deletions app/assets/javascripts/tasks.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
Loading