small medium large xlarge

Generic-user-small
11 Aug 2006, 22:51
Fora User (865 posts)

Hi,

I read somewhere that an upgrade was available for those of us that recently bought the 1st edition of the book (after 4/1). Is this true?

Thanks, Brian

Generic-user-small
24 May 2006, 21:41
Fora User (865 posts)

If you bought a first edition PDF after 4/1, you’ll have already received an complimentary upgrade to the 2nd edition.

Dave

Generic-user-small
13 Jul 2006, 14:40
Fora User (865 posts)

hello,

i am a desktop support officer with a large company, but i would like to start developing websites and applications with ruby on rails.

is this book a good starting tool for novices? i have no knowledge of rails or web programming, but i am familiar with html and css.

any help would be greatly appreciated.

thanks,

pacey

Generic-user-small
29 May 2006, 19:11
Fora User (865 posts)

Maybe I missed this somewhere, but how do we know when new versions of the PDF are ready, and how do we get them?

thanks gord.

Generic-user-small
29 May 2006, 19:11
Fora User (865 posts)

They’ve kept me up-to-date by e-mail. The e-mail contains a link to the reordering form, but you can get there by following a couple of links on the website as well: “http://books.pragprog.com/titles/rails2/reorder”:http://books.pragprog.com/titles/rails2/reorder

Generic-user-small
29 May 2006, 19:20
Fora User (865 posts)

The Depot application is a great way for novices to get started, but I do suppose it assumes basic knowledge of things like variables and methods (functions, if you will). If you’ve ever programmed the tiniest bit before, then that should be enough to get started with this book.

If you’re completely new to programming of any sorts, you might want to check out “Learn to Program” for the real basics.

Generic-user-small
15 Jun 2006, 14:05
Fora User (865 posts)

This is pretty minor, but in the book on page 38-39 (50-51 in the pdf) there is a short html snippet that ends up running over to the next page by one line. Not a big deal, but figure 4.4 is snuck between the html.

Generic-user-small
10 Jul 2006, 08:54
Fora User (865 posts)

Learn to Program is one of the best. It also doesn’t hurt to have Programming Ruby around in addition to the Agile book.

Generic-user-small
10 Jul 2006, 18:32
Fora User (865 posts)

I bought the 1st Edition of the hard copy last week. Any chances of getting a complimentary upgrade? How about a list of changes, so I know what I’m missing?

Thanks, Bart

BTW, Programming Ruby was an excellent read. I’m completely hooked on this series.

Generic-user-small
12 Jul 2006, 21:39
Fora User (865 posts)

I am in the same boat as Bart.

I’d like to see a list of changes for the 2nd edition. It would nice to get the beta version of 2nd edition PDF.

Generic-user-small
13 Jul 2006, 14:40
Fora User (865 posts)

The Rails book (I have Ed 1) has an “Introduction to Ruby” in the Appendix. I think it’s enough to get started programming Ruby on Rails. The key syntax is Ruby, and to get a better handle on it, get the book Michael mentioned, “Programming Ruby”. You can get the 1st Ed at http://www.rubycentral.com/book/ online for free. Although I’ve been programming for a while now, it took me less then a week to learn Ruby from the Programming Ruby book, so I trust the series. Although I haven’t read “Learn to Program”, I can guess it’s as good as the others.

Other then syntax, the key ideas are object oriented programming: encapsulation, inheritance, classes, instances, methods, etc. Ruby has implemented OOP extremely well, and the Pragmatic series explains clearly.

Bart

Generic-user-small
27 Jul 2006, 06:18
Fora User (865 posts)

Just got the newest revision of the 2nd ed, which has the note

It now uses the new Active Record decimal -> BigDecimal conversion…. However, this code is not yet part of a released Gem, so if you want to use the feature, you’ll need to install Edge Rails.

And if we don’t need this feature, will the code in the new revision work with current non-edge rails? Or will we need to run edge rails to run the current Depot code?

Generic-user-small
30 Jul 2006, 21:45
Fora User (865 posts)

I’m also in the same boat as Bart and aaronk

I just recieved the first (paper) edition of the book (19/7/2006), now I look at your site and I see there’s a second edition. Is it possible to get a free PDF update to the second edition or perhaps a very cheap update.

Generic-user-small
11 Aug 2006, 22:51
Fora User (865 posts)

I’m in the same boat. I emailed Customer Service and was told that there’s no discount. I’m deeply disappointed.

Generic-user-small
26 Aug 2006, 21:26
Fora User (865 posts)

First of all, great book!

Actually I’ve read part III twice (and will more likely do it few more) and just can’t wait for update of the “old” chapters.

I have one small problem, when I’m using code for uploading and displaying images from database (p 484, pdf B1.06) images are being displayed only if I point browser directly to image url (ex. /image/show/1) but if I use it in ~~~ <img src=”/image/show/1” /> ~~~ like in the book example it doesn’t work :(

BTW: Really cool forum! but when I was trying to use search I got little confused because of its text-align to the right.

Generic-user-small
29 Aug 2006, 04:50
Fora User (865 posts)

Section 18.5 discusses self-referential joins. I’ve created a class that handles hierarchical organization types (e.g. company and division are both rows in the organization_type table and I would like a parent_id column that fills division with the id for company). Using the example in 18.5 I’m successfully able to make company a parent of division, but this information is not being stored in the database. Sample code snippets are below:

class OrganizationType < ActiveRecord::Base belongs_to :parent_organization, :class_name => “OrganizationType”, :foreign_key => “parent_id”

has_many :child_organizations, :class_name => “OrganizationType”, :foreign_key => “child_id” end

class CreateOrganizationTypes < ActiveRecord::Migration def self.up create_table :organization_types do |t| t.column :name, :string t.column :description, :text t.column :parent_id, :integer t.column :child_id, :integer end end

def self.down drop_table :organization_types end end

Thanks,

Mike

Generic-user-small
17 Sep 2006, 19:19
Fora User (865 posts)

Hi guys, I brought first edition books on end of February. And now already second edition announce. Now just feeling bit tight budget to buy second edition as I am full time university student.

I have checked the second edition table of contains and found most of similar to first edition, except few changes on following:

Chapter 9. Task D: Add a Dasj of Ajax Chapter 11.4 A Sidebar and More User Administration Chapter 12 Task F: One Last Wafer-Thin Change 12.1 Generating the XML Feed Chapter 13 Testing

And also there are sample pdf beta book extract free download to cover chapter 9, 12, 13…..

Just my guess that on second edtion that aren’t much change except some rails specific command update!

Could anyone respond the much details update on second edition books and the worthy of update…….

Thank you……

Generic-user-small
12 Sep 2006, 15:47
Fora User (865 posts)

Seems the index is missing in the later versions, making navigation almost impossible. I’m sure it’ll be in the final versions, but could it please be in the beta ones, too? Just so one can navigate (sub)chapters is well enough.

(If there should be an index, I’m using Evince 0.5.2 in Ubuntu 6.06)

Generic-user-small
17 Sep 2006, 19:19
Fora User (865 posts)

My honest opinion: the second edition is well worth the little money spent.

The changes are far more than the ones you list. The Depot application has been entirely redesigned, but what’s more, the second half of the book has gotten an entire rewrite. It’s gotten a lot larger (e.g. 3 chapters on ActiveRecord!) and for the better. It’s gotten clearer, more exhaustive, and has gotten good coverage of Rails 1.1 and the upcoming 1.2.

I can really recommend getting it.

Generic-user-small
11 Dec 2006, 22:30
Fora User (865 posts)

I have used instant rails to do an install, but now the beta book says to use “edge” to instakll. I am totally confused as to how to proceed. Thanks in advance for any help, particularly from those who have gone through the beta rails book. Sincerely, John Brookes speechexpert@sbcglobal.net

Generic-user-small
16 Oct 2006, 18:46
Fora User (865 posts)

I have used instant rails to do an install, but now the beta book says to use “edge” to instakll. I am totally confused as to how to proceed. Thanks in advance for any help, particularly from those who have gone through the beta rails book. Sincerely, John Brookes speechexpert@sbcglobal

Generic-user-small
19 Oct 2006, 02:00
Fora User (865 posts)

I had the exact question… I am using latest version of instantrails ..I tried below two approaches… however both didnt work ..being a windows user and perforce ..svn is really foreign to me… The things I tried :

1) gem update -s http://gems.rubyonrails.org suggested by DHH at http://www.loudthinking.com/arc/000348.html

but I get an ambiguous option: -s error

2) E:\work\deopt_local\depot>rake rails:freeze:edge –trace (in E:/work/deopt_local/depot) rake aborted! no such file to load – E:/work/deopt_local/depot/config/../vendor/rails/railties/lib/initializer E:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require' E:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require’ E:/work/deopt_local/depot/config/boot.rb:16 E:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require' E:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require’ E:/work/deopt_local/depot/rakefile:4 E:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1828:in load' E:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1828:in load_rakefile’ E:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1900:in run' E:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 E:/InstantRails/ruby/bin/rake.bat:25:in load’ E:/InstantRails/ruby/bin/rake.bat:25

Generic-user-small
19 Oct 2006, 11:34
Fora User (865 posts)

Hello, I have been looking for reference of the with_scope method in the book and have notice that they have dissappeared since beta 10. What is the reason? Is this function deprecated or not recomended to use? Thanks

Generic-user-small
31 Oct 2006, 18:11
Fora User (865 posts)

I want to specify the other error meessage I get without –trace , seems more interpretable…however I still have no idea what can be wrong…any thoughts..

E:\InstantRails\rails_apps\panks>rake rails:freeze:edge (in E:/InstantRails/rails_apps/panks) rm -rf vendor/rails mkdir -p vendor/rails svn: REPORT request failed on ‘/svn/rails/!svn/bc/5378’ svn: REPORT of ‘/svn/rails/!svn/bc/5378’: 400 Bad Request (http://dev.rubyonrails.org) rake aborted! undefined method `[]’ for nil:NilClass

(See full trace by running task with –trace)

Generic-user-small
06 Nov 2006, 09:19
Fora User (865 posts)

Is there manifest/index explaining all the different folders of code in the archive that you can download for the book. There is the depot application of course, and then there are a bunch of other folders like playtime, e1, tmp, work, etc. A listing would be helpful. Thanks.

Generic-user-small
14 Nov 2006, 03:07
Fora User (865 posts)

On page 261, you introduce the concept of data-only migrations. For the purpose of loading development data, it is suggested to use such migrations. I love the idea, but am not sure how to separate these migrations from the rest. If I create them using the generator in my standard migrations directory, they will be run on production, which is not desirable.

So, how do I run these migrations in development, but not in production. I’m aware of no “standard” way of doing this, and don’t see any hints in the book.

Am I missing something simple?

Generic-user-small
15 Nov 2006, 21:16
Fora User (865 posts)

I followed the “Tim Lucas Blog “:http://www.sitepoint.com/blogs/2006/07/11/installing-and-managing-edge-rails/ to start using Rails 1.2

In my ‘Welcome to Ruby’ page at http://localhost:3000/ I see that the Rails version is indeed 1.2. Also, I am able to add a ‘Decimal’ column to the database.

However when I query the rails it prints its version as 1.1.6?

Is Rails not supposed to find the vendor/rails and use that first?

My session follows:

------------------------------------------------
C:\ruby\agile\depot>rake db:migrate
(in C:/ruby/agile/depot)
== AddPrice: migrating ========================================================
-- add_column(:products, :price, :decimal, {:scale=>2, :default=>0, :precision=>8})
   -> 1.0000s
== AddPrice: migrated (1.0160s) ===============================================


C:\ruby\agile\depot>rails -v
Rails 1.1.6
------------------------------------------------

Thank you.

regards – Sai Matam.

Generic-user-small
15 Jul 2007, 04:22
Fora User (865 posts)
In my view, I have a table with a ‘div id=”comments”’ in one of the cells. In that div is a loop, listing all of my current comments. I tried utilizing render :update do page ; page.insert_html :bottom, ‘comments’, “{code containing divs and new comment to add to the bottom of “comments” div}”;end

When I submit the new comment, instead of adding the new comment to the bottom of the div, it replaces the entire page with the “try { New Insertion.Bottom….” code.

I’ve also tried moving the ‘div id=”comments”’ outside of the table to see if it was the location of the div that was preventing the call from working, but no go.

I hate it when I read how simple something is, only to get caught in a gotcha and not know what it is.

Generic-user-small
02 Dec 2006, 15:56
Fora User (865 posts)

Hello,

Just curious, how much does the book cover in terms of the new features of Rails 1.2? I would really really love to buy this book, (I have the 1st ed) but the thing is, I’m afraid that like the 1st edition, this might be outdated very soon. (If not from the get-go)

Please advise.

Thanks, Tim

Generic-user-small
02 Dec 2006, 15:56
Fora User (865 posts)

Enough of them that it requires Rails 1.2 and that the book includes instructions for installing a temporary version of Rails 1.2 locally while it gets released.

Generic-user-small
11 Dec 2006, 22:30
Fora User (865 posts)

I hope this saves some time for getting the program going on page 80:

How to get rake db:migrate to work on page 80!

You will need to install Subversion (http://www.codeproject.com/w2k/SubversionOnWindows.asp).

You will need to set environment variable SVN_EDITOR to C:\Windows\Notepad.exe

You will need to install Edge into vendor/rails (http://www.sitepoint.com/blogs/2006/07/11/installing-and-managing-edge-rails/) of your project or your master vendor/rails.

Other helpful links: How to use Rails With Subversion (http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion) Page 233-237 in Agile Web Development with rails Second edition

Generic-user-small
14 Dec 2006, 14:58
Fora User (865 posts)

Hi, when will the book be available on amazon.com? Its current status is “not yet been released” and when I put it in the cart the “estimated ship date” is February 12, 2007 ?!? Thanks Markus

Generic-user-small
22 Jan 2007, 20:40
Fora User (865 posts)

I’m not seeing this reported elsewhere. so I’ll add it here.

I received a second edition of the book shortly before Christmas. I’ve just noticed that it has a series of pages that are duplicated. Its pages 153 - 184. I suppose there could be more, but thats the section I have noticed.

Generic-user-small
19 Jan 2007, 02:36
Fora User (865 posts)

I downloaded the Rails 1.2 zip from http://media.pragprog.com/titles/rails2/code/rails.zip. It seems to have installed properly (see trace below). However, when I run “rails -v”, it still shows 1.1.6, and not 1.2. Is this correct? Also, how does the app know to use the Vendor rails?

C:\work\demo>rake rails:update –trace (in C:/work/demo) ** Invoke rails:update (first_time) ** Invoke rails:update:scripts (first_time) ** Execute rails:update:scripts install -c -m 0755 C:/work/demo/config/../vendor/rails/railties/lib/tasks/../../bin/process/inspector script/process/inspector ** Invoke rails:update:javascripts (first_time) ** Execute rails:update:javascripts ** Invoke rails:update:configs (first_time) ** Execute rails:update:configs ** Execute rails:update

Generic-user-small
14 Jan 2007, 18:36
Fora User (865 posts)

I experienced the same failure.

If my memory is correct, I saw the same trace messages after unzipping the new version inside the ‘vendor’ directory. But my unzip utility (I’ll blame the software) created another ‘rails’ folder so the resulting path was C:\rails\my_app\vendor\rails\rails

I deleted the extra rails directory, but still was not successful.

Details:

On my Windows XP box I’ve been running Rails 1.1.6 for development. Following the directions inside the front cover of ‘Agile Web Development with Rails, 2nd Edition’ I tried to update Rails to version 1.2. I think my efforts have failed.

Here’s what I did . . .

C:\rails\my_app>rails –v Rails 1.1.6

I downloaded the zipped update file from the pragprog.com site as directed; unzipped it within the ‘vendor’ directory so it’s now showing . . . C:\rails\my_app\vendor\rails

C:\rails\my_app>rake rails:update –trace (in C:/rails/my_app) ** Invoke rails:update (first-time) ** Invoke rails:update:scripts (first_time) ** Execute rails:update:scripts ** Invoke rails:update:javascripts (first_time) ** Execute rails:update:javascripts ** Invoke rails:update:configs (first_time) ** Execute rails:update

C:\rails\my_app>rails –v Rails 1.1.6

There doesn’t appear to be an error message in any of this, but I’m still showing version 1.1.6.

When I browse to http://127.0.0.1:3000 I see the ‘Welcome aboard’ page, but when I click on the link ‘About your applications’s environment’ it says… Application error Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html

I’m stumped. Any suggestions?

Generic-user-small
19 Jan 2007, 02:36
Fora User (865 posts)

The Rails release candidates for 1.2 shipped with their version strings set to 1.1.6. However, they were indeed the proper releases. If you look at the gem versions, you’ll see:

1.1.6.5618 (1.2 rc1) 1.1.6.5848 (1.2 rc2)

Now that Rails 1.2.1 (final) is out, use that instead.

@mps: the app knows to use vendor rails (a.k.a. frozen rails) because it checks for it. If it’s there, it should use it.

Generic-user-small
22 Jan 2007, 20:40
Fora User (865 posts)

18, 19, 22, 23 duplicated

17, 20, 21, 24 missing

Generic-user-small
24 Mar 2007, 23:07
Fora User (865 posts)

The cold_deploy Capistrano task is failing with the following error:

** [out :: meteoro.fuegolabs.com] bash: /home/eap/eap/current/script/spin: No such file or directory command finished command “/home/eap/eap/current/script/spin” failed on meteoro.fuegolabs.com

I’m using Rails 1.2.2 as there is no such file in my application. I’m following the book example and there is no reference on how to get this file or configure Capistrano to ignore it. Any ideas?

Thanks,

Carlos

Generic-user-small
14 May 2007, 22:45
Fora User (865 posts)

Can anyone give me a thumbs up or thumbs down if ActionView method form.select(:attribute, choice, option, html_options) is supposed to work or even where I could research this further on my own. I’ve dug through the api and can’t even find this command, but it’s in the book on pages 485-487 and I can’t get any of the examples to work.

Thanks,

The Shaheenery

Generic-user-small
24 Mar 2007, 03:06
Fora User (865 posts)

I’m having the same problem with cold_deploy: * command “sudo /pk/current/script/spin” failed on www.blah.com

I’m running rails 1.2.3 and haven’t been able to find a way around this. Any ideas?

Cheers,

Dan

Generic-user-small
24 Mar 2007, 23:07
Fora User (865 posts)

Hey Dan,

If you’re using mongrel, the mongrel_cluster comes with some drop-in replacements for Capistrano’s restart and spinner tasks. Just add this line to the top of your deploy.rb:

require 'mongrel_cluster/recipes'

Otherwise, you should find something helpful on the Capistrano spinner and here:

http://manuals.rubyonrails.com/read/chapter/100#page268

Hope that helps! Richard

Generic-user-small
12 Apr 2007, 13:20
Fora User (865 posts)

In AWDWR 2nd ed, (pg415), it suggests using the following to allow the custom action to create a new resource:

map.resources :articles, :new => { :shortform => :post }

resulting in the following url method and path:

POST /articles/new;shortform

However having new in the url for a standard resource usually presents the form prior to creation at url:

GET /articles/new

and the posting of the creation actually takes place at the following URL:

POST /articles

So when adding a custom action to create a resource why not use:

map.resource :articles, :collection => { :shortform => :post }

which results in a url as follows that more closely matches the standard restful urls?

POST /articles;shortform

Generic-user-small
28 Apr 2007, 10:35
Fora User (865 posts)

I consider fora.pragprog.com website a top notch resource, so wanted to share some of my personal experiences here… If you are not in the industry, please don’t waste your time, as this wouldn’t make much sense to you :)

I try to stay current on all issues concerning web design, web development, search engine optimization and all the other bells and whistles that come with those :), so I kind of know what www stands for… Continually educating myself gives me some advantage in dealing with the most professional website design companies, like Zallas Technologies (http://www.zallas.com), which is the company that I want to talk about here… All went well, at first, and I have been receiving an e-mail update almost every day (quite unique for this industry, I have to tell you…) Scott, my husband, told me that we should outsource 2 more projects to Zallas people immediately, but I decided to wait (and boy, was I right!?).

A week later, after they gave us only about 10-15 designs to choose from (I was expecting at least 30 by now), they assign 2 more managers to our account – 1 from QA and 1 from the Technology Team… Before, we only dealt with the Project manager and the Design Team guy (what a hassle to deal with so many dedicated professionals, I have to tell you…) Confused? Read along, as this is not over yet…

After they satisfied my design preference and I have decided to go with the mockup #62, version C, they give me all these tools to manage my site: a CMS to manage all the content throughout my website any time I want (who would want such a thing, right?), a CRM to manage all the clients within my site, down to the contact information, calendar of events, client statuses, phone calls, etc.

Anyway, they gave me so much, that I am confused… I thought I was clear in my ad, that I want a site exactly like eBay for under $1500 – is that so hard to do? I didn’t know that there’s such a complex backend system involved… tracking statistics, managing disputes, resolving transaction problems and vendor relations… Did you know that the traffic goes down during the American Idol show? Wow…

Anyway, after 6 weeks of development, I was running my online website business without a single internal resource – everything is automated (I have no one to talk to…). I miss those days when I had 2 personal assistants and 3 salespeople (and we still couldn’t put it all together), and now all of a sudden, my website is running it all? I start to think that it’s actually not bad and am currently considering paying a second invoice after running my store for about 7 months and making a ton… Maybe, after all, it’s a two-way street and we should respect our vendors as much as they are dedicated to us. Hmmm…

Dedicated to all webmasters, website developers and professional website design companies in this tough, but rewarding business. You are the creative minds behind our future – the Internet!

http://www.zallas.com

Generic-user-small
14 May 2007, 22:45
Fora User (865 posts)

Yes, I agree. The book e.g’s are not clear. I’ve never used them inside the form_for block, instead using form_tag. The api references lots of conflicting stuff, it’s difficult to know what applies and what doesn’t. Something like this could well do with a full-page of examples. Then there are things which are not documented at all. At the end of the day it is frustrating and extremely time consuming.

Generic-user-small
10 Jun 2007, 17:19
Fora User (865 posts)

In the section on routing nested resources (page 419 in second printing – 2007 – of Agile Web Development with Rails)the authors show an example of the CommentsController. The create action seems to contain an error, but since I don’t see it listed in the errata, I wonder if it is not in fact incorrect.

The example action says:

def create

@comment = Comment.new(params[:comment])

if (@article.comment « @comment)

redirect_to article_url(@article)

else

render :action => new

end

end

Instead of: if (@article.comment « @comment) I’d think it should say something like: if @comment.save

I don’t see where the save is actually taking place. Why would @article.comment append @comment if it doesn’t get saved?

Second, don’t we need a respond_to block? I don’t see that in the CommentController.

Thanks!

Generic-user-small
15 Jul 2007, 04:22
Fora User (865 posts)

In your remote_form_for, did you specify :update => “comments”?

Generic-user-small
06 Sep 2007, 09:46
Fora User (865 posts)

Sorry guys ignore this post. I just realized it shouldn’t be here. Refer to depot application category.

Hey guys,

I have been trying to implement the login example from the book (chapter 11). I have followed everything as stated except I’m using a field called ‘username’ instead of name used by the book.

The error that i get is “NoMethodError in LoginController#login

undefined method `salt’ for “kala”:String”

I would really appreciate any suggestions.

Regards

Raj

Generic-user-small
20 Oct 2007, 11:24
Nicolas Aguttes (1 post)

Hello,

one week ago I was looking at PlayTime discussion concerning the section E3 about implemnting payments_types in a table but I could not find anymore this discussion (I followed the link provided in the book)

thanks Nicolas

You must be logged in to comment