Jul 21, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Help with XML

Having myself been caught up in the Web Services and SOAP craze a few years back, I understand the appeal of having your requests “generated” for you. But I’ve since reformed, and co-authored a book on REST and strongly suggest to everybody who will listen that they resist that urge.

Generating XML is easy using builder

There are no separate schemas to worry about, and you have full control over the element names.

 
Jul 21, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Error using store layout for admin

The next printing of the book will have little arrows next to all of the lines that you need to insert. This printing neglected to highlight the insertion of <% if @cart > and < end %> around that line.

The full version of that file should look like this:

http://media.pragprog.com/titles/rails3/code/depot_q/app/views/layouts/store.html.erb

 
Jul 17, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / So what's new?

If you get stuck, comment here.

If something confuses you but you eventually figure it out, mark it in the errata. Even “user errors” which are recorded in the errata are treated very seriously.

In prior editions, common errors and the solutions are listed in many chapters. This edition will retain such and even expand it based on errata.

That’s why errata is so important—I, for one, can’t always see what is obvious to me that might not be obvious to everybody else.

 
Jul 17, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / How often is the beta being updated?

Just a note that I’m still here and listening. I apologize for the delay and am actively working on an update. More when I have concrete news to report.

 
Jul 11, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Chapter 3: Installing Rails - Keep it!

I’m still new to OS X, and frankly I’m a bit surprised at how hard basic things are as compared to Ubuntu, but in any case I started from the instructions I found on Developing Rails Applications on Mac OS X Leopard that I found on the Apple Developer Connection website.

In a subsequent pass over the book, I’ll look into adding information on compiling the code for yourself and introduce the notion of not overwriting the system installed versions.

 
Jun 29, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails / ADWR depot app w/Passenger?

I installed the sqlite3-ruby-1.2.2 gem and added it to my environment

 
Jun 28, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails / ADWR depot app w/Passenger?

I didn’t have any problem getting the beta of edition 3 depot application running on Rails 2.0.2 on Dreamhost: http://depot.intertwingly.net/store

 
Jun 27, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / adapters needed

This is all deja vu

I suggest that you take it slower. Here’s what I said before:

Then proceed to starting the server.

Were you able to do that?

Only after you have been able to start the server, verify that you can access the server from the mysql client.

Was this successful?

Only after you have been able to verify access from the mysql client, try the simple ruby program I provided above.

Did you try this?

Only after the simple ruby program has been verified should you try configuring Rails to use mysql.

. . .

 
Jun 27, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Confusion in iteration F4 (ch 11.4)

The next beta will have little triangles pointing at the

<% if @cart %>

and

<% end %>

lines in the depot_q/app/views/layouts/store.html.erb file excerpt that immediately follows that paragraph. I apologize for the omission.

 
Jun 27, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / adapters needed

Did you check the mkmf.log ?

 
Jun 24, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / adapters needed

On the systems I have installed it, mysql’s default user is root, and default password is blank, and generally are accompanied by instructions to change the password. Try it. But if you’ve changed the password, I don’t think I can be of much help with trying to recover it.

Previously I argued against reinstalling, based on not knowing what is going on, which made me concerned that reinstalling wouldn’t necessarily address the problem. But if the problem is a lost password, then re-installing may be an option.

I would recommend proceeding incrementally. Reinstall mysql if you must. Then proceed to starting the server. Only after you have been able to start the server, verify that you can access the server from the mysql client. Only after you have been able to verify access from the mysql client, try the simple ruby program I provided above. Only after the simple ruby program has been verified should you try configuring Rails to use mysql.

 
Jun 19, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Confusion over login

Chapter 13 has not been updated to Rails 2.x. See pages 2 and 15 for more details. Or just look at the color of the bars at the top and bottom of the pages.

 
Jun 19, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Confusion over login

In beta 1.3, the text is on page 170, and reflects the correct directory name. Please verify which printing you are looking at—it is at the very bottom right of the page (inside the red bar), and should read “this copy is (B1.3 printing, June 4, 2008)”.

 
Jun 17, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / When will Depot sample be updated to 2.1?

OK, I’m convinced. The next beta will use the following form:

respond_to do |format|
  format.js
end
 
Jun 17, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Confusion over login

I will confirm that http:/localhost:3000/admin/login is the correct URI to use. The image on page 170 has yet to be updated.

In B1.3 the text read: ‘Create the template in the file index.html.erb in the directory app/views/admin.’

 
Jun 17, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Problem with deployed app

Unfortunately, I’ve not seen this.

Placing the following in app/controllers/application.rb should make the symptoms go away:

self.allow_forgery_protection=false
 
Jun 17, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / When will Depot sample be updated to 2.1?

do…end and {...} accomplish the same thing (there is a minor difference as to precedence order, but that doesn’t apply here).

The nested {...} blocks are optional, and aren’t needed in this case.

The net is that the following are essentially identical:

respond_to { |format| format.js }
respond_to do |format|
  format.js {}
end

Let me think about this a bit more.

 
Jun 16, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / When will Depot sample be updated to 2.1?

Thursday, June 05, 2008

 
Jun 16, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / adapters needed

What happens when you try to start mysql?

sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &
 
Jun 15, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / ITERATION F1: ADDING USERS

I don’t believe so. In developing B1.0, B1.1, and B1.2, I had been testing under both 2.0.2 and rails edge. B1.3 was updated so that the text matched 2.1, but the only substantive changes involved were the ones I mentioned above.

 
Jun 15, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / adapters needed

Before assuming that you are messed up, are you sure that the server is started?

Also, just curious: you are aware that most of the topics covered in the book are database independent, right? Sqlite3 has fewer moving parts (in particular, no separate server). You should be able to proceed with sqlite3 in parallel while you are resolving this issue.

 
Jun 13, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Error after adding 'layout "store" ' to application.rb

My apologizes. Those lines are present on page 175 (and the text on page 174 tells you that you need to make these changes), but there aren’t little triangles next to these two lines to draw your attention to them.

This will be corrected in the next beta.

 
Jun 13, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / Getting NoMethodErrors after completing A4

The lines you quoted look like they are from app/views/products/index.html.erb and not from app/views/layouts/products.html.erb

By any chance, did some of these lines get added (appended?) to the end of the layout? Check both files against the links provided above.

 
Jun 13, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / adapters needed

Before trying to install another version of MySQL, let’s see what you have got. I’m concerned about the confusion that trying to use the binding that you generated for one version of MySQL against another version of MySQL may cause.

Since the ‘require’ failed, you either don’t have the Ruby binding gem installed, or Ruby can’t find it. Let’s try two things.

First, lets verify that you have MySQL client and server installed:

mysql -u root
select version();
quit;

I’m following along on Ubuntu, and get 5.0.45-Debian_1ubuntu3.3-log.

Next, lets try adding an explicit require for rubygems:

irb
require 'rubygems'
require 'mysql'
m = Mysql.new(host, user, passwd)
m.query('select version()').each {|row| puts row}
 
Jun 13, 2008
Samr_small_small Sam Ruby 111 posts

Topic: Agile Web Development with Rails, 3rd Edition / ITERATION F1: ADDING USERS

Given that we are talking about a book that will be published in print form October-ish and people will be buying in stores next year, my focus is to keep up with the latest Rails. Starting with B1.3, this means Rails 2.1.

The two differences that were encountered in the upgrade were in Migration (the names of the migration files changed, and Rails internally keeps track of exactly which migrations have been applied, and not merely the last one) and a minor formatting change in the edit scaffold produced by generate/scaffold.

111 posts

Page: 1 2 3