small medium large xlarge

Generic-user-small
25 Jun 2010, 16:35
Malcolm Arnold (21 posts)

This problem seems to be caused by incorrectly linked links in the pdf.

If I understand correctly(pg 19 explains text below), I click on a grey box outlining the file for the download of a snippet and if my browser supports hyperlinks then what will happen is a new browser window will open with the text of that snippet. I should say that the download link on page 38 works as described above and in the text below. The browser window refreshes with the code/snippet displayed.

I have problems with the following links(will update this as I encounter them): Pg 19, Pg 37, first link Pg 41, 78, 83, 94, 95

I am using Explorer 8.0.x and reading in adobe Reader 9.3.2.

This is what happens: first get a security warning that I am tying to connect to the website: XXX/say_controller.rb

I allow

Then I am asked if I want to open or save the file.

I click open thinking that this will open the text(code) in a browser to read. IE asks me do I want to open webcontent using this program on your computer. That file is C:\Ruby19\bin\ruby.exe I allow this and a little black screen opens very quickly and closes.

Please let me know what I am doing wrong or if I misunderstand how the grey link boxes are supposed to work.

thanks in advance

To help you find your way, if a code listing can be found in the download, there’ll be a bar above the snippet (just like the one here). Download work/demo1/app/controllers/say_controller.rb class SayController < ApplicationController def hello end def goodbye end end This contains the path to the code within the download. If you’re reading the ebook version of this book and your ebook viewer supports hyperlinks, you can click the bar, and the code should appear in a browser window. Some browsers (such as Safari) will mistakenly try to interpret 2. http://pragprog.com/titles/rails4/source_code has the links for the downloads. Report erratum this copy is (B4.0 printing, May 26, 2010) Prepared exclusively for Robert M Arnold HOW TO READ THIS BOOK 20 some of the templates as HTML. If this happens, view the source of the page to see the real source code. And in some cases involving the modification of an existing file where the lines to be changed may not be immediately obvious, you will also see some helpful little triangles on the left of the lines that you will need to change. Two such lines are indicated in the previous code.

Cimg0269_pragsmall
23 Jun 2010, 05:53
Seth Arnold (22 posts)

If I’m not mistaken, IE’s behaviour on “open” is to essentially execute the content. If it is a .doc, then it’ll be as if you ran “start foo.doc”, which should probably open word. If it is an .exe, then it’ll be as if you ran “start foo.exe”, which will just start executing the program. If it is a .dll, then it’ll run “start foo.dll”, which will probably be the same as “rundll foo.dll”.

So you’ve got an .rb file, associated with the ruby interpreter, and if you run “start foo.rb”, then it’ll probably start the ruby interpreter and pass your file to it, with the intention of running it. Just like foo.pl will start the perl interpreter, foo.bat will start cmd.exe, and so forth.

Because it’s so bloody dangerous to run things grabbed off the web before reading them, I suggest getting in the habit of ignoring ‘open’, and rely on the ‘save’ button. That way you can manually inspect things in notepad or run them through your suite of AV on-demand scanners to make sure they’re not awful…

Generic-user-small
23 Jun 2010, 14:16
Malcolm Arnold (21 posts)

Thanks Seth, great advice.

I am at page 66 in the book and all the other links worked as notated so I am thinking that the links I mention above are just incorrectly linked.

Cimg0269_pragsmall
24 Jun 2010, 10:18
Seth Arnold (22 posts)

Ah! :) That’s probably an important point. Hehe. :)

You must be logged in to comment