By Developers, For Developers

Historical errata for Rails, Angular, Postgres, and Bootstrap

Does the ‘l’ belong there? It’s in the Example Code too, so maybe it does. But doesn’t match the limited html/Rails that I know.

I noticed it looking for another problem (yet to be solved).

PDF PgPaper PgTypeDescriptionFixed onComments
47TYPO

Second sentence, paragraph four. “Aaron assumes that be de-activating Sally’s email account, she won’t have access to any more internal systems.”

“Be” should be “by”.

2015-07-31
1TYPO

Bootstrap isn’t “Twitter Bootstrap” after version 3

2015-07-31
1TYPO

that is often refered to as a stack ==> referred

2015-07-31
3TYPO

table based a SELECT statement ==> based on a SELECT

2015-07-31
3SUGGEST

In the intro to AngularJS, when listing the jQuery code, I’d suggest to add a headline “jquery_example.html” analogous to the “angular_example.html” headline further down.

2015-07-31
7TYPO

problems have a solutions in Angular’s ==> a solution (or have solutions)

2015-07-31
7SUGGEST

in the internal applications ==> did you mean “in their internal” (I’m not sure here)

2015-07-31
9TYPO

using semantic HTMl will ==> HTML

2015-07-31
15TYPO

mistakes. For the later, you can ==> for the latter (at least I think you meant that :-)

2015-07-31
18TYPO

Here’s what what we want ==> what we want

2015-07-31
19TYPO

when we start to using AngularJS. ==> start using (or start to use)

2015-07-31
38TYPO

but it will just as simple ==> will be just as

2015-07-31
39TYPO

The :validtable “module” ==> :validatable

2015-07-31
41TYPO

features for prevent bad data ==> preventing

2015-07-31
42TYPO

In even in a small company, ==> Even in

2015-07-31
42TYPO

processes that accesses the database ==> access the

2015-07-31
42TYPO

meaning a sofware bug could ==> software

2015-07-31
42TYPO

If you done any database work ==> you’ve done

2015-07-31
46TYPO

and the piece of mind it gives ==> peace

2015-07-31
50TYPO

et great performance out Postgres ==> out of Postgres

2015-07-31
50TYPO

will search one of tables in that database ==> one of the tables

2015-07-31
53TYPO

Since we adding unique constraints ==> we were adding (or we added)

2015-07-31
2419TYPO

> creatuser —createdb —login -P shine

Typo creatuser should be createuser

2015-07-31
28ERROR

npm install bower —> npm install -g bower

2015-07-31
57TYPO

“lower(email) = :email OR”, { ==> “lower(email) = :email”, {

2015-08-01
12TYPO

$(".details).toggle();

[missing a double-quote]

2015-08-01
11ERROR

`bundle exec rails new` doesn’t work until you have a Gemfile. Readers will have to install rails and use just `rails new`.

2015-08-01
24ERROR

The command to create the Rails app is given as “bundle exec rails new […] shine” — when I do this with “ruby -v” 2.2.1p85 and “rails -v” 4.2.3 I get “Could not locate Gemfile or .bundle/ directory”

Omitting the “bundle exec” from the front makes it work. I don’t think “bundle exec” is necessary when creating the app.

2015-08-01
37ERROR

“Since we changed config/application.rb you should restart your server” — we didn’t change config/application.rb, we changed app/assets/stylesheets/application.css, right?

2015-08-01
42SUGGEST

The app/views/devise/registrations/new.html.erb file has “<%= devise_error_messages! %>” — if you try to submit registration with errors (like a short password), you get the Rails behavior where it wraps invalid elements with div.field_with_errors and explains at the top, etc., which I’ve always hated. It would be cool if you showed us a nice Bootstrappy way to style these!

2015-09-01
44ERROR

“Now, if we try to register with a short password or an invalid email,” — I had to restart my server, since an initializer was changed.

2015-08-01
47TYPO

“you must weight the cost of the security breach against” should be “weigh” (no “t”)

2015-08-01
62TYPO

“We have to do this becaue ActiveRecord” — should be “because”

2015-08-01
62ERROR

“To execute this query using ActiveRecord, we’d need to write the following code:” — the Customer.where line shown here has an extra “OR” after “:email”

2015-08-01
81ERROR

The _pager partial adds the “disabled” class to the “previous” element, if we’re on page 0, which greys it out and changes the cursor to a “no” glyph. However, the “previous” button is still clickable, and results in a Rails “OFFSET must not be negative” error.

2015-08-01
90SUGGEST

Why does the label tag have for=“search.keywords” and not just for=“keywords”? (Isn’t the label “for” attribute supposed to match the input “name” attribute?)

2015-08-01
119TYPO

“Here’s what we’ll add to spec/rails_helper.rb, with the most relevant parts high- lighted.” — the highlight arrow points to the “infer_spec_type” line; it should point to the “use_transactional_fixtures” line (which is changing from “true” to “false”)

2015-08-01
132TYPO

“Since we dont’ want it in our production code” — should be “don’t”

2015-08-01
10TYPO

Materialized Views A database view is a logical table based a SELECT statement.

I think the “a” in front of “SELECT” is superfluous? Also I think the words “table based” should be hyphenated: “table-based” in the same line.

2015-08-01
18TYPO

On page 18 of the document (page numbered 12)

“we’ll implement a naive fuzzy search”

“naive” should be “native”?

-

2015-08-01
52SUGGEST

Perhaps some direction on how to setup the postgres database. It was fairly annoying to get it setup on Arch Linux. And the book gives zero instruction for any of the major OS’s. I’d recommend at least going over OSX and Ubuntu.

There’s also a few times where you’ll talk about what we need to do but its kind of implied that its done. For example: The customer controller. We only generated the model, we never generated a controller. So you either need to manually create the file, or rails g controller customer (pg 52 in pdf). This situation happens a few times throughout the book.

In addition to these, there are some minor typo errors that I’ve noticed, but didn’t keep track of because it was common sense. Like creatuser needed to be createuser when creating the database user.

Good book, I’m about half way through so far, and look forward to finishing it and reading future revisions!

2015-08-04
32TYPO

On page 32 of the document, numbered 27:

“This is a very real problem, since the world of front-end libraries is much larger Rails.”

Should this be:

“This is a very real problem, since the world of front-end libraries is much larger than Rails.”

-

2015-08-04
46TYPO

On page 46 of the document, numbered 41:

Most SQL databases do not have powerful features for prevent bad data.

Should be:

Most SQL databases do not have powerful features for preventing bad data.

2015-08-04
47TYPO

On page 47 (numbered page 42):

When faced with security issues like this, you must weight the cost of the security breach against the cost of preventing it.

Change “weight” above to “weigh”

2015-08-04
51ERROR

On page 51 (numbered 46) I cannot replicate the testing of the Postgres constraint as per the example. When entering:

INSERT INTO users(email,encrypted_password) VALUES (‘foo@example.com’, ‘abcdefghij10’);

I get:

ERROR: null value in column “created_at” violates not-null constraint

Instead of:

INSERT 0 1 as per the expected output according to the book.

Additionally I do not get error message “ERROR: new row for relation ”users" violates check constraint “email_must_be_company_email” when entering an incorrect user email as the message “ERROR: null value in column ”created_at" violates not-null constraint" appears to be raised first.

2015-08-04
51ERROR

On page 51 (numbered 46) to replicate the testing of the Postgres constraint as per the example.

You need to enter the created_at and updated_at timestamps to achieve the output as presented in the book:

INSERT INTO users(email,encrypted_password,created_at,updated_at) VALUES (‘foo@example.com’, ‘abcdefghij10’, ‘2004-10-19 10:23:54’, ‘2004-10-19 10:23:54’);

TO GET:

INSERT 0 1 (record created).

ALSO:

INSERT INTO users(email,encrypted_password,created_at,updated_at) VALUES (‘foo@abc.com’, ‘abcdefghij10’, ‘2004-10-19 10:23:54’, ‘2004-10-19 10:23:54’);

to get error message “ERROR: new row for relation ”users" violates check constraint “email_must_be_company_email”.

2015-08-04
53TYPO

On page 53 (numbered 48):

We’ll start this feature by implementing a naive fuzzy search …

“naive” should be “native”

2015-08-02
55TYPO

On page 55 (numbered 50)

First, we’ll implement a naive fuzzy search that allows our users to locate customers based on first name, last name, or email.

“naive” should be “native”?

-

2015-08-04
55SUGGEST

On page 55 (numbered 50)

After that, we’ll examine the performance of the query ActiveRecord is executing by examining Postgres’ query plan.

After that, we’ll investigate the performance of the ActiveRecord query by examining Postgres’ query plan.

2015-08-04
55TYPO

On page 55 (numbered 50)

Same typo again:

Let’s go to it by implementing a naive version of the search.

“naive” should be “native”

I suggest a global find and replace! ;-)

2015-08-04
59TYPO

Page 59 (page number 54)

That route will expect an index method on the CustomersController class, so let’s create that, next.

No need for comma between the last two words in the sentence.

2015-08-04
63TYPO

On page 63 (page numbered 58)

In the code listing for CustomerSearchTerm there is a missing “end” statement.

2015-08-04
42TYPO

Aaron assumes that be de-activating Sally’s

2015-08-04
11TYPO

Materialized Views A database view is a logical table based a SELECT statement. In Postgres a materialized view is a view whose contents are stored in

It should be: based {on} a select statement.

2015-08-04
67TYPO

Page 67 (numbered 62):

This can be done be preceding a SQL statement with explain analyze.

“be” should be “by”

2015-09-01
72TYPO

Page 72 (numbered 67)

The user interface actually isn’t too bad, either, considering we didn’t spent much time on it.

“spent” => “spend”

2015-09-01
74TYPO

Page 4 (numbered 70):

Let’s trying using the list group component.

trying => try

2015-09-01
9TYPO

“and using semantic HTMl will result in” — HTMl should be HTML

2015-09-01
19SUGGEST

“Let’s call our new application shine (since it will allow our users to shine as they do their work, assisted by all the wonderful features we’ll be able to add for them), and will use Postgres instead of the default SQLite database.” — without the parenthesis is “Let’s call our new application shine, and will use Postgres instead of…” — Consider removing the “will” — “Let’s call our new application shine, and use Postgres instead of…”

2015-09-01
19TYPO

“creatuser —createdb —login -P shine” — creatuser should be createuser

2015-09-01
27TYPO

“This is a very real problem, since the world of front-end libraries is much larger Rails.” — should be “…much larger than Rails.”

2015-09-01
109SUGGEST

Had to run bundle exec rake db:migrate RAILS_ENV=test before bundle exec rake worked. May be worth mentioning it - or maybe it was just my setup?

2015-09-01
35ERROR

The screenshot shows above “Log in” the text “You need to sign in or sign up before continuing.” — That text does not appear on my screen as I follow the tutorial — Likely related to displaying flash messages, which Devise warns about when installed but also which the book advised to ignore.

2015-09-01
116SUGGEST

Highlight the line config.use_transactional_fixtures = false as one of the most relevant parts.

I know I should have released after reading the proceeding text but didn’t notice I had to change it as the line already existed but with a different value in the config file.

2015-09-01
42TYPO

“When faced with security issues like this, you must weight
the cost…” — “…you must weigh the cost…”

2015-09-01
5853TYPO

“Since we adding unique constraints to those fields
when creating the table…” — should be “Since we’re adding…”

2015-09-01
0SUGGEST

In the PDF, bookmarks for chapters 9 through 14 don’t have subheadings, as do bookmarks for chapters 1 through 8

2015-09-01
6863TYPO

“Postgtes allows you to create an index” — Postgtes should be Postgres

2015-09-01
6964ERROR

in the AddLowerIndexesToCustomers migration, the down method specifies three calls to remove_index. The syntax for those remove_index calls is incorrect. For example, the line…

remove_index ‘customers_lower_last_name’

…should actually be…

remove_index :customers, name: :customers_lower_last_name

…and similar for the other two.

2015-09-01
7773TYPO

“use help achieve our design…” — should be “use to help achieve our design…”

2015-09-01
7781ERROR

Although ‘disabled’ CSS gets applied to a nav button if page == 0, you can still click the button and move to page –1, –2, etc.

2015-09-01
8582TYPO

“Angular makes it easy to implement this feature, although there’s a fair bit of one-time setup we have do to get there.” — should be “…one-time setup we have to do to get there.”

2015-09-01
8582TYPO

“First, we’ll get Angular set up in our application, validating it with very simple Angular app…” — should be “…validating it with a very simple Angular app…”

2015-09-01
27TYPO

The last paragraph in the “Why not use RubyGems?” callout has this line:

…the world of front-end libraries is much larger Rails.

It should be “is much larger than Rails.”

2015-09-01
19TYPO

This statement:

creatuser —createdb —login -P shine

Should be “createuser …” — missing the “e”.

2015-09-01
70TYPO

3rd to the last paragraph:

“Let’s trying using the list group component.”

Should be “Let’s try using…”

2015-09-01
8(TYPO

Last paragraph, won’t’ should be won’t

2015-09-01
19TYPO

> creatuser —createdb —login -P shine

should be

> createuser —createdb —login -P shine

2015-09-01
000TYPO

Can’t specify the page because I’m reading ebook.

In section “Installing bootstrap with Bower”, first paragraph, third phrase, we can read “realty” instead of “reality”. The full phrase is:

“The realty of software development, especially for internal tools…”

2015-09-01
39TYPO

“The :validtable ‘module’…” should be written “The :validatable ’module…”

2015-09-01
104SUGGEST

This page mentions installing RSpec for the first time. However, Rails generator examples very early in the book show RSpec invocations i.e. it’s installed at that point.

2015-09-01
122ERROR

I am stuck in the testing part (page 122 in the PDF version of this book) under “Testing the Typeahead Search”. I keep getting getting failed results when running the “shine/spec/features/customer_search_spec.rb” test (I even copy-pasted the code from the book). the errors below:

1) Customer Search Search by Name
Failure/Error: expect(page.all(“ol li.list-group-item”).count).to eq(4)

expected: 4
got: 0

(compared using ==)
# ./spec/features/customer_search_spec.rb:67:in `block (3 levels) in <top (required)>’
# /usr/local/rvm/gems/ruby-2.2-head/gems/capybara-2.4.4/lib/capybara/session.rb:285:in `within’
# /usr/local/rvm/gems/ruby-2.2-head/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in
# ./spec/features/customer_search_spec.rb:65:in `block (2 levels) in <top (required)>’

2) Customer Search Search by Email
Failure/Error: expect(page.all(“ol li.list-group-item”).count).to eq(4)

expected: 4
got: 0

(compared using ==)

Not sure if there is some missing instruction in the book. I just followed the book step-by-step.

I am pretty new with Angular so I am not sure if I just missed something.

2015-09-01
39SUGGEST

The period in the “example.com” in the email validation regexp should be escaped. The regex should read `/\\A[^]+example\\.com\\z/`. As written, emails ending in “exampleacom”, “example1com”, etc will validate.

2015-09-30
147TYPO

Missing part of the code:

~
(…)

Joined
{{ customer.created_at | date }}

{{ customer.first_name }} {{ customer.last_name }}
{{ customer.username }}

(here goes

…)
~

2015-10-04
43SUGGEST

The period in the “example.com” in the check validation regexp should be escaped. The constraint should read `CHECK ( email ~* ‘[A-Za-z0-9._%-]+@example\\\\.com’ )`. As written, emails ending in “exampleacom”, “example1com”, etc will validate

2015-09-30
~154TYPO

In chapter 8, I think you forgot to implement the “viewDetails” function

2015-09-30
57TYPO

“We have to do this becaue ActiveRecord has no direct API for doing this”, “becaue” should be “because”

2015-10-02
93ERROR

The updated listing for the search-results section does not include the ng-if directive to conditionally render the section.

This will cause the tests on page 123 to fail because results haven’t yet loaded.

The section markup should read something like `

`

2015-10-02
123TYPO

“Further, our tests relay on DOM elements…” should read “Further, our tests rely on DOM elements…”

2015-10-04
124TYPO

“to do more sophisitcated tests.” should read “to do more sophisticated tests.”

2015-10-04
45ERROR

The given regex for the constraint leaves a lot of holes and weird errors.
Current regex: ‘[A-Za-z0-9._%-]example.com' Problems: 1. Raises exception in Rails on emails with equals or plus signs in them. Fix: use the same character set as the one for devise. 2. Accepts 'exampleacom' as domain. Fix: escape the dot (this is also an issue in the regex on page 39). 3. Accepts 'example.com.mydomain.com' as domain, still allowing email addresses outside the company domain. Fix: insert start and end anchors. Suggested regex: '^[^]example\\\\.com$' The whole line should read: CHECK ( email ~* '^[^]+@example\\\\.com$’ )

2015-10-02
144TYPO

“This gem will handled compilation” should read “This gem will handle compilation”

2015-10-04
145ERROR

angular-rails-templates does not work with the 3.x version of Sprockets. If you run the tests with the most current gems you’ll get the following error.

```
2) Customer Search Search by Email
Failure/Error: Unable to find matching line from backtrace
ActionController::RoutingError:
No route matches [GET] “/customer_search.html”
```

Issue #93 on the github repo for the angular-rails-templates gem is to make it compatible with Sprockets 3.0

The workaround is to explicitly require sprockets 2.12.3 in your Gemfile

gem ‘sprockets’, ‘2.12.3’

2015-10-04
2TYPO

“Digging deeper into the other two parts of stack…”

2015-09-30
2TYPO

In the first sentence of the last paragraph: “Digging deeper into the other two parts of stack will have …”, “of stack” should be “of the stack”.

2015-09-30
12TYPO

- “We’ll then move onto”
+ “We’ll then move on to”.

2015-09-30
allERROR

Google Play Books is not able to process the epub version of the eBook.

26ERROR

Create postgrs db user shine fails on mint 17 for local db.

postgres@jfair-VirtualBox ~ $ psql -d postgres -U postgres
psql (9.3.9)
Type “help” for help.

postgres=# createuser —createdb —login -P shine;
;
ERROR: syntax error at or near “createuser”
LINE 1: createuser

2015-09-30
64TYPO

Top line reads “,,, a method exceute which”
should be “a method execute which”

2015-10-02
29ERROR

The devise command could use backslashes at the end of the lines to indicate that it all goes on the same line.

2015-09-30
1SUGGEST

The use of naked ng- attributes cause the HTML generated to not be technically valid. Practically, this isn’t really a problem, but it’s probably worth pointing out.

2015-09-30
1SUGGEST

Mention that sprockets 3.x and angular-rails-templates 0.14 are not compatible. Not sure if this should be in the book explicitly, or maybe just in the code.

2015-09-30
91-92SUGGEST

The code example for “searchedFor” is not consistent with the analogy.

  1. /views/customers/index.html.erb
  2. wrapping only a part of the line
    Searched for: {{searchedFor}}
  1. Rails analogy
  2. wrapping the whole line
    Searched for: <%= searchedFor %>
2015-10-02
339TYPO

Chapter 10 sets out various hypothetical methods of accessing the multiple tables related to customer details. It then proceeds directly to migrating the materialized view without explicitly migrating the address and state tables, which the materialized view relies on.

2015-10-04
93ERROR

The markup must have ng-if=customers.length > 0 or the acceptance tests won’t work

2015-10-02
31TYPO

“When you you navigate to the homepage”

2015-11-28
INTROINTROTYPO

IN THE INTRODUCTION Typo in word “develoeprs”

The Rails framework encourages develoeprs
..vs..
The Rails framework encourages developers

2015-11-28
44ERROR

I had some errors with the database.yml. For some reason I had to “stackoverflow” why the database connection was not working. I discovered that sometimes you had to add “Host” in the database.yml file.
It might help to have to info in the book as well. It is very encouraging when a book covers this kinds of details.

default: &default
adapter: postgresql
encoding: unicode
host: localhost

username: shine

password: shine
pool: 5

development:
<<: *default
database: shine_development
host: localhost

test:
<<: *default
database: shine_test
host: locahost

2015-11-28
359ERROR

You guide the reader on page 9 to use dbconsole and suggest a few things to execute \\x and a select. It would be useful to know that “\\q” will provide a way to exit.

2015-11-28
4014ERROR

Another issue I got when doing bower install is that the internet provider was blocking my downloads so “connection refused” was a common response for my bower installs. After “Stackover”ing it I found an answer

…questions/16298986/unable-to-connect-to-github-com-for-cloning

This is actually what worked for me
git config —global url.“h t t p s : / / ”.insteadOf git://

..note remove spaces..

it would also be worth noticing in the book. It is more encouraging when a book has been tested in this little details. Specially in the little tiny details, which might make the reader, stop reading the whole book and drop the studies on that direction.

2015-11-28
6337TYPO

the section with number 350_000 for the seeder does not run until you change it to 350000

2015-11-28
106TYPO

The footnote is wrong.

2015-11-28
13SUGGEST

i’d suggest you explain how to generate the bower file to include the dependencies. I like to use json. I’ve used this command: rails g bower_rails:initialize json.

2015-11-28
114TYPO

“Jasmine provide a function named beforeEach that works like before in RSpec.” should be “Jasmine provides a function named beforeEach that works like before in RSpec.”

2015-11-28
166TYPO

“The use of EXPLAIN ANALYZE us useful in explaining poor performance, not in identifying it.” should be “The use of EXPLAIN ANALYZE is useful in explaining poor performance, not in identifying it.”

2015-11-28
168TYPO

The record from ADDRESSES_WITH_STATES with ID 12 is shown as:
id | 12
street | 11828 Kuhn Turnpike
city | Willmsmouth
state | WA
zipcode | 46419-7547

But then, immediately after, ActiveRecord returns a different state for the same record?
AddressesWithState.find(12).state

  1. => DC

Shouldn’t it be:
AddressesWithState.find(12).state

  1. => WA
2015-11-28
191TYPO

“As you’re recall, $resource creates a factory…” should be “As you’ll recall, $resource creates a factory…”

2015-11-28
227TYPO

“JSON columsn support the -> operator” should be “JSON columns support the -> operator”

2015-11-28
11TYPO

“The Rails framework encourages develoeprs”

2015-11-28
32SUGGEST

Restart your server isn’t necessary, just reload it

2015-11-28
63SUGGEST

instead you use email: “#{Faker::Internet.user_name}#{i}@#{Faker::Internet.domain_name}”) you could use faker method Faker::Internet.email

2015-11-28
74SUGGEST

It’s not necessary to inject $scope in angular anymore (at least in versions >= 1.2).

2015-11-28
87SUGGEST

Isn’t better instead use
<%= link_to_if page > 0,
“← Previous”.html_safe,
customers_path(keywords: keywords, page: page - 1) %>

and use

<%= link_to raw(“← Previous”),
customers_path(keywords: keywords, page: page - 1) if page > 0 %>

Thus the link above does not appear without functionality and is more beautiful

2015-11-28
23ERROR

The regexp for constraining the email domain is missing a backslash before the dot in .com. This allows any character to be entered, for example examplezcom. It should be config.email_regexp = /\\A[^]+example\\.com\\z/

2015-11-28
27TYPO

It says:
CHECK ( email ~* ‘[]+example\\\\.com’ )
It should say:
CHECK ( email ~* ‘[A-Za-z0-9._%-]+@example\\.com’ )

2015-11-28
xxivTYPO

1st paragraph, 2nd sentence: “…our journey through this topic has a different sudirectory, …”
Should be subdirectory.

2015-11-28
89SUGGEST

I installed rspec on my system and somehow ended up with version 2.11 and didn’t realize that you were using rspec 3.x. I suggest mentioning which versions of rspec and other gems you are using in the examples or locking them down in the Gemfile to the major release.

2015-11-28
1ERROR

down migration should be remove_index :customers, name: ‘customers_lower_email’

2015-11-28
156TYPO

We’ll also see how we can use database triggers to keep the automatically view up-to-date.

Maybe this should be “triggers to automatically keep the view up-to-date”

2015-11-28
170TYPO

the down migration

execute “DROP VIEW customer_details”

should be:

execute “DROP MATERIALIZED VIEW customer_details”

to match the type of view being created in the up migration

2015-11-28
101TYPO

“let’s plan our how it will work” should probably be “let’s plan out how it will work”.

2015-11-28
114TYPO

“Jasmine provide a function” should probably be “Jasmine provides a function”

2015-11-28
116TYPO

“Unfortunately, Jasmine doesn’t provide matcher to compare the values” . . . maybe “a matcher” or “matchers”?

2015-11-28
118TYPO

“we’ll also create a varaible”

2015-11-28
82TYPO

$scope.customers = []; is errantly omitted from the code listing. This gives the impression that the line should be removed.

2015-11-28
126ERROR

The ngRoute should not have a comma on in this code

This
[
‘ngRoute’,
]

Should be
[
‘ngRoute’
]

2015-11-28
129SUGGEST

It might be worth noting that when installing sprockets 2.0 in the latest version of rails you have to downgrade multiple packages

I did this with;
bundle update sprockets sprockets-rails sass-rails

2015-11-28
130SUGGEST

Instead of duplicating the pager code you could use ng-include to use partials through AngularJS

2015-11-28
74SUGGEST

To help with AngularJS objects working in production after being minified you could use ng-annotate. This allows you to keep the functions dry.

2015-11-28
10TYPO

“develoeprs” instead of “developers”.

2015-11-30
166143TYPO

Using Bootstrap’s Grid • 143:

“What this means it that, if have sufficiently generic CSS classes”

“What this means IS that, if WE have sufficiently generic CSS classes”

2015-11-30
86TYPO

“It’s one thing to get code working IN a browser, but it’s another to have the confidence in that code that you can ship it TO your users.”

2015-12-11
26TYPO

Should the title of the section be “…Devise and Rails leave open” rather than “…leaveS”?

2015-12-11
92TYPO

“…it will be difficult to using ActiveRecord…” should be “…it will be difficult to use ActiveRecord…”

2015-12-11
141ERROR

The “defaults to an empty customer list” test is failing with:
Failure/Error: Expected undefined to equal data [ ].

After long hair-pulling debugging session I realized that there is a difference in code stated in the PDF and “real” code available for download and should be corrected.
The code in question is located at the page (pdf) 106 - there is piece of code missing in customers_app.js.

Wrong:
var page = 0;

$scope.search = function ….

Should be:
var page = 0;

$scope.customers = [];
$scope.search = function …

2015-12-12
97TYPO

“Now, we’ll install Poltergeist […]. To this, add it to the testing group…” probably should be “To do/accomplish/achieve/etc this,…”?

2015-12-12
98TYPO

“…want our acceptance tests to normally run using an special in-process driver…” should be “…a special in-process driver…”

2015-12-12
101TYPO

“run code before any tests runs” should be “any test runs” or “any tests run”?

2015-12-12
102SUGGEST

In the code listing at the bottom of the page, would it be better to use the `email` and `password` variables in calls to `fill_in` rather than hard-coding the values assigned to them?

2015-12-12
167ERROR

On the end of the ‘create view’ it’s missing a semi colon ‘;’

2015-12-12
74TYPO

3rd paragraph: “So, we need [to] explicitly tell Angular…”

2015-12-11
-SUGGEST

I suggest you use angular to login as well. The gem angular_devise is a service for interacting with devise. Or maybe you should teach how to do that. I was wondering how I could implement a two-way-data-binding registration after I finish reading the book… It’s very common in applications.

2015-12-11
259238ERROR

Error in the clojure. ‘(’ missing before function.

2015-12-12
158TYPO

Last sentence of third paragraph from the bottom reads “…and shipping addresses are also available to us vis the shared database.” Believe “vis” should be “via”, although, as it happens, Vis is a small Croatian island in the Adriatic sea.

2015-12-12
90SUGGEST

.rb is not neccessary for require “rails_helper.rb”

2015-12-11
30SUGGEST

Having the file paths prepended with login/create-dashboard/shine is a bit confusing. On page 30, you ask the reader to edit config/database.yaml , then ask them to cd to shine. I think it makes more sense to put the ‘cd shine’ before the file edit, and then update all subsequent code listings so that their path is relative to the current shine directory.

For instance, on page 31, login/create-dashboard/shine/config/routes.rb should just be config/routes.rb .

I understand you may have set this up because we will have multiple versions of shine, but while reading the book, it’s just confusing.

2015-12-14
42TYPO

you is repeated in:

“When you you navigate to the homepage, you’ll see that”

2016-01-10
90ERROR

When I tried:

➤ asset ‘angular’, ‘~> 1.4’

it failed ( I didn’t capture the error).

However, I tried:
➤ asset ‘angular’

and this installed version 1.4.8 correctly. I’m not sure why the previous attempt failed.

2016-01-10
allSUGGEST

My apologies. I sent a couple of bug reports on B4.0 that really were issues with B3.0; I did not find a way to delete them, but please ignore them.

2016-01-10
xxivERROR

Intro page xxiv contains the link for source code, but when code download is attempted, the following error is reported back:

ERROR
The request could not be satisfied.
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.

Generated by cloudfront (CloudFront)
Request ID: _cuGTsL3st88yoA8VERp2YvVFTWI5rxQiDXv4Q29fkPCYfkwmGvunQ==

40TYPO

The screenshot of custom search view isn’t from this stage of the app,
as it has paging controls, etc.

2016-01-10
29SUGGEST

Perhaps change all three RegEx on page 29 to the one on page 27.
From ‘[A-Za-z0-9._%-]example\\.com' to '^[^]@example\\\\.com’

2016-01-10
49ERROR

The query displayed to analyze after adding the lower indexes is different from the original query tested on pg. 46. The one on pg. 46 used ‘LIKE’ for first_name and last_name; the after-index query on pg. 49 uses exact matches for first_name and last_name.

2016-01-10
44ERROR

The following code:

where_clause << " OR #{case_insensitive_search(:email)}" where_args[:email] = search_term

Will generate the following SQL where condition:

OR lower(email) like ‘name@domain.com’

which is not what we want (we want an exact match). The code needs to be changed to not use case_insensitive_search, as it is currently written.

2016-01-10
89TYPO

The ‘rspec-rails’ gem is listed twice in the example Gemfile, once with a version constraint and once without.

2016-01-10
84ERROR

In searchTerm length test, if user hits search without entering keywords it will throw a TypeError.
This doesn’t occur after the typeahead feature is completed, but it would be better to test that search term has a value.

if (!searchTerm || searchTerm.length < 3) {
return;
}

Ps. Happy New Year!

2016-01-10
83SUGGEST

In previousPage function, the page variable is decremented with “page = page - 1;”,
it would be idiomatic to use “page—;” (or “page -= 1;” to be consistent with Ruby).

This suggestion applies also to the nextPage function.

2016-01-10
66SUGGEST

The Bowerfile specifies angular 1.5
“asset ‘angular’, ‘~> 1.5’”,
but rake output show installation of angular#1.4.3.

Bowerfile also uses resolution method, which isn’t needed and it’s meaning isn’t explained:
“resolution ‘angular’, ‘1.5’”
It would be clearer without the resolution line or if it’s meaning could be explained.

2016-01-10
77TYPO

There’s a typo in ERB/erubis opening tag:
“as well as replace the <@= .. %> with Angular’s curly-brace syntax.”
Should be:
“as well as replace the <%= .. %> with Angular’s curly-brace syntax.”

2016-01-10
114TYPO

5th paragraph, 3rd sentence: “Note that angular-mocks need to . . . brought in, so we’ll add it add the require after we’ve . . . ” should be: " . . . brought in, so we’ll add the require after we’ve . . . "

2016-01-10
118ERROR

In customer_search_controller.js within the “Fetching Search Results” describe block, there should be ‘beforeEach(module(“customers”));’ before the inject statement. Otherwise CustomerSearchController will be undefined.

2016-01-10
120TYPO

2nd paragraph, 2nd sentence: " . . . to starting spying on window’s alert function . . . " should be " . . . to start spying on window’s alert function . . . "

2016-01-10
89TYPO

Duplicate rspec-rails entries in the Gemfile:

group :development, :test do
gem “rspec-rails”
end

group :development, :test ​do​
gem ​“rspec-rails”​, ​’~> 3.0’
end

2016-01-10
160SUGGEST

There should probably be instructions for creating the models for the new tables in the migration. Without the associated models, the seed process will fail, as will any of the subsequent ActiveRecord actions for those following along.

2016-01-10
180TYPO

In example code at the bottom of the page, 4th line: ’ var url = base = “/cardholder/” + data.cardholder_id ’ should be: ’ var url = base + “/cardholder/” + data.cardholder_id ’

2016-01-10
197ERROR

In customer_credit_card_controller_spec.js, missing explicit declarations for controller and httpBackend within the Initialization block.

2016-01-10
120ERROR

The search method implemented on page 79 uses then with success and error callbacks (not .success() and .error()) and the message contains statusText not status:
alert(​“There was a problem: ”​ + response.statusText);
Because of this, the test spying on window.alert is also broken.

2016-01-10
125TYPO

Following sentence refers that the app already uses ng-view directive, but the actual markup in this stage of the app is ’

’:

"The view is hard-coded by virtue of having all the HTML inside

.
The controller is hard-coded by the use of the ng-controller directive."

2016-01-10
1ERROR

When reading with the Kindle application on a Mac the diagrams are on the wrong pages. I can supply screen shots if you like (no way to attach an image on this form!). For example in the Introduction the text says “With these chosen technologies, our application stack looks like this:” followed by a picture of an information icon. There is an application stack diagram but it is 10 pages further on. The next paragraph ends: “so at the start of each chapter, you’ll see a roadmap like this of what you’ll be learning:” followed by a diagram of the Rails default startup page. As far as I can tell (I’m only up to Chapter 4) this is true of ALL the diagrams in the book.

68TYPO

In sentence:
“Armed with this knowledge, as well as our helper method extract_name_from_email, we can now implement build_for_email_search.”

“extract_name_from_email” must be “extract_name”.

Source code is fine in this context.

68SUGGEST

In source code snippet on this page and all other pages I suggest to UPPERCASE all SQL keywords, i.e. LIKE, OR, AND, ASC, DESC, etc.

69TYPO

Image should not contain filled search input at this stage of development.

On this stage search input should be empty as search form re-renders along with search results.

58SUGGEST

Should not we add `disabled` if statement for “next” button as we did for “previous”?

6287ERROR

I looked at the Node semver documentation which resolves versions of packages. I see that you can use the tilde operator, however I do not think that tilde with a greater than sign is valid. It isn’t raising an error, but the documentation doesn’t explain what happens in this case. Its doing the same thing as Ruby’s pessimistic operator, but the syntax is different. Looking at the generated bower.json, this is not being translated in any way from the Bowerfile. Is this correct?

73SUGGEST

Not obvious when did we get rid off the section:

Searched for: {{searchedFor}}

76101TYPO

The name of the helper method in Rails has been omitted:

> One thing you’ll notice is that created_at is a timestamp, not a date, so it’s not
rendering exactly how we’d like it. In our ERB template, we converted it to a
date using the l helper method. Angular has a different way to handle this.

This should be:

> One thing you’ll notice is that created_at is a timestamp, not a date, so it’s not
rendering exactly how we’d like it. In our ERB template, we converted it to a
date using the #to_date helper method. Angular has a different way to handle this.

10378SUGGEST

Not obvious when did we switched from $http.get().then() syntax to $http.get().success().error() ?

media.pragprog.com/titles/dcbang/code/typeahead/angularized-search/shine/app/assets/javascripts/customers_app.js

media.pragprog.com/titles/dcbang/code/typeahead/angularized-pagination/shine/app/assets/javascripts/customers_app.js

11086SUGGEST

Should we omit “.rb” and just do require ‘rails_helper’ ?

12399SUGGEST

Instead of

email ||= “#{Faker::Internet.user_name}#{rand(1000)}@” + “#{Faker::Internet.domain_name}”

should not we make

email ||= “#{Faker::Internet.user_name}#{rand(1000)}@#{Faker::Internet.domain_name}”

134110TYPO

Broken link to code snippet source.

media.pragprog.com/titles/dcbang/code/testing/angular-unit-test/shine/spec/javascript%20…%20p/controllers/customer_search_controller_spec.js

137113SUGGEST

Would not be better to add `beforeEach(module(‘customers’));` right after `serverResults = {…}` block?

151128SUGGEST

The following code missed in snippet:

Joined {{ customer.created_at | date }}

{{ customer.first_name }} {{ customer.last_name }}
{{ customer.username }}

OR

Just should be added as short comment:

// customer data goes here…

152129TYPO

Sentence “Remember that the Rails portion of the URL for our Angular app is /customers/” should end with dot instead of forward slash.

155132TYPO

Broken link to snippet source.

Should be fixed to:
media.pragprog.com/titles/dcbang/code/complex-views/navigation-to-new-view/shine/spec/javascripts/customers_app/controllers/customer_detail_controller_spec.js

1SUGGEST

Organize the Erratum by page numbers in order. I say page number plural because there seems to be different pagination for the pdf and the book.

Maybe one of the readers can work up a stack to handle this.

39TYPO

Last td:

<%= l customer.created_at.to_date %>

169147TYPO

The image under caption “The result looks pretty nice:” should not contain “" symbol in "username" input. As "” symbol appears only in the next section “Form Add-ons”.

171149SUGGEST

Footnote #1.

There is large amount of directories in source code archive.
Probably it worth mention that complete UI template for this chapter can be found inside archive at path:
./code/complex-views/ui/shine/app/assets/javascripts/templates/customer_detail.html

27ERROR

The email regex in the migration is incorrect and does not match what it shown on the following pages (28, 29).

00TYPO

In source code media.pragprog.com/titles/dcbang/code/materialized-views/data-model/shine/db/seeds.rb on line 106:

  1. ecah time through

should be

  1. each time through
275256ERROR

In media.pragprog.com/titles/dcbang/code/materialized-views/actual-materialized-view/shine/app/models/customer.rb on line 13:

self.customers_shipping_address.find_by(primary: true).address

should be

self.customers_shipping_addresses.find_by(primary: true).address

Otherwise it returns error:
NoMethodError: undefined method `customers_shipping_address’ for #

176154ERROR

shipping_address: customer.shipping_address

should be

shipping_address: customer.primary_shipping_address

184162TYPO

Broken link to materialized view migration:
“media.pragprog.com/titles/dcbang/code/materialized-views/actual-materialized-view/shi%20…%20204_create_customer_details_materialized_view.rb”

should be

“media.pragprog.com/titles/dcbang/code/materialized-views/actual-materialized-view/shine/db/migrate/20150625130204_create_customer_details_materialized_view.rb”

189167TYPO

Broken link to migration:

media.pragprog.com/titles/dcbang/code/materialized-views/actual-materialized-view/shi%20…%20150626120132_trigger_refresh_customer_details.rb

should be

media.pragprog.com/titles/dcbang/code/materialized-views/actual-materialized-view/shine/db/migrate/20150626120132_trigger_refresh_customer_details.rb

189167TYPO

Regarding 20150626120132_trigger_refresh_customer_details.rb.

Empty methods
def up
end
def down
end

Should be removed.

19ERROR

The text on the image for the login page shows:

‘You need to sign in or sign up before continuing.’

but this is not in the code and is not displayed in the browser.

73ERROR

The angular code for the ng-repeat of customer in customers is trying to render {{ customer.name }} however the data structure for each customer doesn’t have a name property. Instead it should be trying to render {{ customer.first_name }}.

293ERROR

The app creation code suggested is this:
“$ rails new —skip-turbolinks \\
—skip-spring \\
—skip-test-unit \\
-d postgresql \\
shine”
but for Rails commands after “new” should be the app name, in this case “shine”, otherwise the app created will be called “—skip-turbolinks”.

135111ERROR

It appears that the 2.3.4 version of teaspoon-jasmine (current at time of writing) has a syntax change to the addMatchers syntax. The example from this page should now be:

beforeEach(function() {
jasmine.addMatchers({
toEqualData: function(util, customEqualityTesters) {
return {
compare: function(actual, expected) {
return {
pass: angular.equals(actual, expected)
}
}
}
}
});
});

The version specified in the book yields a cryptic error when executed: Failure/Error: TypeError: undefined is not a function

202180ERROR

In angular-async/start/shine/app/controllers/fake_billing_controller.rb there is extra comma in statement “detailsLink: Faker::Internet.url,”.

206184ERROR

Missed couple of closing

tags in snippet “angular-async/progress/shine/app/assets/javascripts/templates/customer_detail.html”.

90TYPO

we’re expecting constaint_name

should be

we’re expecting constraint_name

239219ERROR

postgres (PostgreSQL) 9.5.0

Does not work for me:

sql> select id,insights from customers
where insights@>‘{ “curiosity”: { “accessories”: true }}’;

Returns:

ERROR: operator does not exist: json > unknown LINE 1: SELECT id,insights FROM customers WHERE insights>’{"curios…
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

242222SUGGEST

Probably it’s more convenient to use symbol instead of string here:

add_column :customers, :status, “customer_status”, default: “signed_up”, null: false

change to:

add_column :customers, :status, :customer_status, default: “signed_up”, null: false

247227SUGGEST

There is no mention of how `customer_summary.html` should look like.

Especially it needs to point that we use `cust` instead of `customer` and `viewDetailsFunction` instead of `viewDetails` in customer_summary.html.

That was not obvious to me.

250230TYPO

Missed open open parenthesis in:

function() {
var app = angular.module(

Should be:

(function() {
var app = angular.module(

250230ERROR

Should `app.config([…` be included in IIFE?

260240ERROR

It’s, probably, better to remove quotes.

So

`Then, we’ll add //= require ‘angular-bootstrap’ to app/assets/javascripts/application.js.`

will be

`Then, we’ll add //= require angular-bootstrap to app/assets/javascripts/application.js.`

110SUGGEST

In order for the test to run successfully the listing needs the following two changes (add the var and enclosing quotes in $scope):

var scope = null,
var controller = null;
….
“$scope”: scope

93SUGGEST

Did you miss some preprocessor directives in the code:

  1. START_HIGHLIGHT
    gem ‘poltergeist’
    # END_HIGHLIGHT
1318SUGGEST

Inconsistent and confusing with code examples:
1. There are many instances in the Angular and Bootstrap chapters where it’s not apparent which file is being edited, what code should be deleted and what code should be inserted. For example, Chapter 8’s code examples are mess to the point following along is really frustrating. The code examples are missing file path headers (which were used previously), so I’m not 100% where to look the download files provided. The Angular sections also suffer similar issues, though it’s easy to pull ip the file to check work if need be because there is a header with the path to the file.

2. The “>>” icon in code examples are misleading because the code added is usually multiple lines, which there is only, at times, “>>” one icon. Have also found that code is being skipped, so it’s almost an necessity to check work against the dowloaded files.

Suggestions:
1. Show deleted code with strikethrough
2. Be better about where to insert new code
3. Include all code that needs to be inserted
4. Make headings consistent with code examples. Each code example should have a heading with the file path.
5. Use “>>” for newly inserted code on each line the newly inserted code is on

4136ERROR

“Testing Jasmine”
->Error: LoadError: cannot load such file — coffee_script
Added coffee-script to gemfile then many:
Rails.application.config.assets.precompile += %w( support/phantomjs-shims.self.js )
Added to assets.rb:
Rails.application.config.assets.precompile += %w( support/phantomjs-shims.self.js )
Rails.application.config.assets.precompile += %w( jquery/dist/jquery.self.js )
Rails.application.config.assets.precompile += %w( jquery_ujs.self.js )
Rails.application.config.assets.precompile += %w( angular/angular.self.js )
Rails.application.config.assets.precompile += %w( angular_test_app.self.js )
Rails.application.config.assets.precompile += %w( customers_app.self.js )
Rails.application.config.assets.precompile += %w( application.self.js )
Rails.application.config.assets.precompile += %w( spec_helper.self.js )
Rails.application.config.assets.precompile += %w( dummy_spec.self.js )

then the test worked.

79ERROR

Missing only in the book text, not the source code: the three “$scope.loading =” statements.

108TYPO

In order * to do * pass in a real scope…..

70TYPO

Our $scope argument might be renamed a during minification.
sould be
Our $scope argument might be renamed during minification.

68SUGGEST

I was enjoying this book until page 68.
It starts throwing JS code onto the reader without explaining where it goes, making it very confusing and frustrating for a beginner.
One of the best things about other pragprog.com books is the fact that once there is a new block of code to be entered by the user it shows the content of the file (including existing code) but outlines the new lines to be added with arrows on the left margin so the reader can get a context of where this code block should go and understand what’s going on.
This doesn’t happen in this book, at least in this chapter.
I was considering giving up on the book but will try and push through to see if I can make sense of what’s going on from here.

132ERROR

The requested URL /titles/dcbang/code/complex-views/navigation-to-new-view/shine/spec ƒ p/controllers/customer_detail_controller_spec.js was not found on this server.

90TYPO

Here, we define our matcher and state its name…We’ve named the argument we’re expecting constaint_name. <—- **should be “constraint_name”

31ERROR

"We’ll then need to remove the old db/schema.rb file, create db/structure.sql by running migrations,………

How is structure.sql created?

178TYPO

For the dynamically filled in customer_show.html template:

{{ customer.joined_at | date }} ought to be {{ customer.created_at | date }}

13SUGGEST

In the procedure to install bootstrap with Bower, there is no step to create the Bowerfile. From the repo I found the following command to create the bowerfile:

rails g bower_rails:initialize

That creates the bowerfile and also a init file in config.

6363TYPO

You appear to install 1.5 but the book and PDF show 1.4.3

bower angular#1.4.3 not-cached
bower angular#1.4.3 resolve
bower angular#1.4.3 download
bower angular#1.4.3 extract archive.tar.gz
bower angular#1.4.3 resolved
bower angular#1.4.3 install angular#1.4.3

Btw, how does one determine the “version of the book”? I just guessed at the version.

Categories: