Skip to content

Commit

Permalink
updated readme, tests, support files
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellbenton committed Aug 30, 2018
1 parent 27e4d67 commit 71a8a0a
Show file tree
Hide file tree
Showing 7 changed files with 312 additions and 38 deletions.
41 changes: 35 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Created by https://www.gitignore.io/api/node

.DS_Store

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Learn-specific .results.json
.results.json

# Ignore bundler config.
/.bundle
Expand All @@ -15,4 +43,5 @@
/log/*
!/log/.keep
/tmp
Gemfile.lock


8 changes: 5 additions & 3 deletions .learn
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
tags:
- tag1
- rails
- partials
- lab
languages:
- language1
resources: 0
- ruby
resources: 0
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Contributing to Learn.co Curriculum

We're really exited that you're about to contribute to the [open curriculum](https://learn.co/content-license) on [Learn.co](https://learn.co). If this is your first time contributing, please continue reading to learn how to make the most meaningful and useful impact possible.
We're really excited that you're about to contribute to the [open
curriculum](https://learn.co/content-license) on [Learn.co](https://learn.co).
If this is your first time contributing, please continue reading to learn how
to make the most meaningful and useful impact possible.

## Raising an Issue to Encourage a Contribution

Expand Down
203 changes: 203 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.10)
actionview (= 4.2.10)
activesupport (= 4.2.10)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.10)
activesupport (= 4.2.10)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.10)
activesupport (= 4.2.10)
globalid (>= 0.3.0)
activemodel (4.2.10)
activesupport (= 4.2.10)
builder (~> 3.1)
activerecord (4.2.10)
activemodel (= 4.2.10)
activesupport (= 4.2.10)
arel (~> 6.0)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
annotate (2.7.4)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 13.0)
arel (6.0.4)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
builder (3.2.3)
byebug (10.0.2)
coderay (1.1.2)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
crass (1.0.4)
debug_inspector (0.0.3)
diff-lcs (1.3)
erubis (2.7.0)
execjs (2.7.0)
faker (1.9.1)
i18n (>= 0.7)
ffi (1.9.25)
globalid (0.4.1)
activesupport (>= 4.2.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.6)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
method_source (0.9.0)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_json (1.13.1)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.6.0)
byebug (~> 10.0)
pry (~> 0.10)
rack (1.6.10)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.10)
actionmailer (= 4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
activemodel (= 4.2.10)
activerecord (= 4.2.10)
activesupport (= 4.2.10)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.10)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (4.2.10)
actionpack (= 4.2.10)
activesupport (= 4.2.10)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rdoc (4.3.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (3.8.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sdoc (0.4.2)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
spring (2.0.2)
activesupport (>= 4.2)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.18)
execjs (>= 0.3.0, < 3)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
ruby

DEPENDENCIES
annotate
coffee-rails (~> 4.1.0)
faker
jbuilder (~> 2.0)
jquery-rails
pry-byebug
rails (~> 4.2)
rspec-rails (>= 2.0.0.beta)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
sqlite3
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)

BUNDLED WITH
1.16.1
24 changes: 20 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
#Learn.co Educational Content License
# Learn.co Educational Content License

Copyright (c) 2015 Flatiron School, Inc
Copyright (c) 2018 Flatiron School, Inc

The Flatiron School, Inc. owns this Educational Content. However, the Flatiron School supports the development and availability of educational materials in the public domain. Therefore, the Flatiron School grants Users of the Flatiron Educational Content set forth in this repository certain rights to reuse, build upon and share such Educational Content subject to the terms of the Educational Content License set forth [here](http://learn.co/content-license) (http://learn.co/content-license). You must read carefully the terms and conditions contained in the Educational Content License as such terms govern access to and use of the Educational Content.
The Flatiron School, Inc. owns this Educational Content. However, the Flatiron
School supports the development and availability of educational materials in
the public domain. Therefore, the Flatiron School grants Users of the Flatiron
Educational Content set forth in this repository certain rights to reuse, build
upon and share such Educational Content subject to the terms of the Educational
Content License set forth [here](http://learn.co/content-license)
(http://learn.co/content-license). You must read carefully the terms and
conditions contained in the Educational Content License as such terms govern
access to and use of the Educational Content.

Flatiron School is willing to allow you access to and use of the Educational Content only on the condition that you accept all of the terms and conditions contained in the Educational Content License set forth [here](http://learn.co/content-license) (http://learn.co/content-license). By accessing and/or using the Educational Content, you are agreeing to all of the terms and conditions contained in the Educational Content License. If you do not agree to any or all of the terms of the Educational Content License, you are prohibited from accessing, reviewing or using in any way the Educational Content.
Flatiron School is willing to allow you access to and use of the Educational
Content only on the condition that you accept all of the terms and conditions
contained in the Educational Content License set forth
[here](http://learn.co/content-license) (http://learn.co/content-license). By
accessing and/or using the Educational Content, you are agreeing to all of the
terms and conditions contained in the Educational Content License. If you do
not agree to any or all of the terms of the Educational Content License, you
are prohibited from accessing, reviewing or using in any way the Educational
Content.
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Partials with Locals

Now that we learned about locals, let's refactor our old codebase and add a couple new features using this new tool.
Now that we learned about locals, let's refactor our old codebase and add a
couple new features using this new tool.

## Objectives

Expand All @@ -10,24 +11,39 @@ Now that we learned about locals, let's refactor our old codebase and add a coup
4. Use a partial from another controller with a local

# Overview
So your team's lead engineer looked over the codebase and asked you to not refer to instance variables in your partials but rather to pass through local variables. That way, your code will be more explicit about its dependencies when it calls the partial.

So your team's lead engineer looked over the codebase and asked you to not refer
to instance variables in your partials but rather to pass through local
variables. That way, your code will be more explicit about its dependencies
when it calls the partial.

Also, the lead engineer asked for a couple new features.

The first is that we display _all_ students on the classroom show page instead of singling out the oldest student with a special note. The engineer thinks this isn't very polite.
The first is that we display _all_ students on the classroom show page instead
of singling out the oldest student with a special note. The engineer thinks
this isn't very polite.

Second, they also want to add some search functionality so that a user can search for a student by name. It's okay if other students with similar names are returned in the search results.
Second, they also want to add some search functionality so that a user can
search for a student by name. It's okay if other students with similar names are
returned in the search results.

## Instructions

1. Refactor the `_form.html.erb` partial to accept the argument to the `form_for` helper as a local. You'll also need to change the `new.html.erb` and `edit.html.erb` views as well.
1. Refactor the `_form.html.erb` partial to accept the argument to the
`form_for` helper as a local. You'll also need to change the `new.html.erb` and
`edit.html.erb` views as well.

2. Refactor the `_student.html.erb` partial to pass through each rendered student as a local.
2. Refactor the `_student.html.erb` partial to pass through each rendered
student as a local.

3. On the classroom show page, iterate through each classroom's students and display each of them using our `_student.html.erb` partial with locals.
3. On the classroom show page, iterate through each classroom's students and
display each of them using our `_student.html.erb` partial with locals.

4. Create a `_classroom.html.erb` partial to display classroom information on the classroom show page.
4. Create a `_classroom.html.erb` partial to display classroom information on
the classroom show page.

5. Add in search functionality such that users can search for a student by name and see all matching results on the students index page. The results should be displayed by rendering a `students/_student.html.erb` partial.
5. Add in search functionality such that users can search for a student by name
and see all matching results on the students index page. The results should be
displayed by rendering a `students/_student.html.erb` partial.

<p data-visibility='hidden'>View <a href='https://learn.co/lessons/partial-locals-lab'>Partial with Locals Lab</a> on Learn.co and start learning to code for free.</p>
Loading

0 comments on commit 71a8a0a

Please sign in to comment.