Quantcast
Channel: Pragmatic Forums | Posts in topic 'Chapter 7: Rails Interface With Heyu'
Viewing all articles
Browse latest Browse all 2

Chapter 7: Rails Interface With Heyu posted by Bob Cochran @ Tue, 01 Nov 2011 00:40:25 +0000

$
0
0

I just followed the instructions on pp. 96-100 to build the Rails web application client. It works just fine for me. I have some feedback about this. Here is a screen shot of my web page result.

http://dl.dropbox.com/u/11392729/rails_controll…

Section 7.4 “Writing the code for the Web Client”

Why is the sidebar “X10 Problems” at the top of the next page, interrupting the continuity of the discussion on building the web client with rails? This should be moved to before Section 7.4.

Why do you show so many lines of rails output like this:

create
create  README
create  Rakefile
create  config.ru
create  .gitignore
create  Gemfile
create  app

It might be better to show 2 or 3 lines, then an ellipsis to indicate output continues. This way you won’t be plagued with inquiries from readers who tell you their corresponding output doesn’t look precisely like the above.

Likewise, what does all this give you—what does it express or show?

> cd x10switch
    > rails generate controller Command cmd
create app/controllers/command_controller.rb route get "command/cmd" 
          invoke  erb
          create    app/views/command
          create    app/views/command/cmd.html.erb
          invoke  test_unit
          create    test/functional/command_controller_test.rb
          invoke  helper
          create    app/helpers/command_helper.rb
          invoke    test_unit
          create      test/unit/helpers/command_helper_test.rb

I suggest showing only the first 4 lines of output. Same reasoning applies.

Near the bottom of page 98, where you write:

If you’re setting up a newer version of Rails (such as Rails 3.1) on a Linux system, 

Discussion of additional Rails configuration and installation activity should be a separate sidebar, moved entirely out of section 7.4. It interrupts the flow of building the actual web client.

Section 7.5 “Testing Out the Web Client”

After the last paragraph of page 99, you might want to answer things like:

What do I do if it is not working? What is the fault tree to follow here—what things do I check for first?

What is all this stuff in the terminal window that Rails is emitting? (Imagine a reader with a panicky look firing off anxious emails to you…and I see plenty of those sort of looks almost from users who are not computer centric in their careers.)

Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2011-10-31 19:32:43 -0400
Served asset /application.js - 304 Not Modified (0ms)

Started GET "/command/off" for 127.0.0.1 at 2011-10-31 19:34:23 -0400
  Processing by CommandController#cmd as HTML
  Parameters: {"cmd"=>"off"}
Rendered command/cmd.html.erb within layouts/application (0.2ms)
Completed 200 OK in 1115ms (Views: 13.0ms | ActiveRecord: 0.0ms)

Less experienced readers will almost certainly become panicky and worry that the computer is being terribly damaged or they are doing something wrong. So it might be good to suggest a rails startup option that will quiet nonessential output.

What does the -d option to `rails s’ do?

If I put this:

$HOME/projects/ruby/rails/homprojects/x10switch

in my .profile or .bash_profile or other environment path, will `rails s’ start the x10switch project?

What if I try to start multiple Rails projects? How will the other projects impact this one?

I hope all this feedback helps. Really, what you have is pretty good. With a little added detail and moving of nonessential sidebar material, it becomes fantastic. I was up and running rapidly. But then again I expected this.

One final note. Rails strikes me as being very similar to the Catalyst framework, except Catalyst is unnecessarily complex and it requires Perl which is pretty much losing ground as a programming language. Perhaps you might want to briefly discuss doing the web interface in this framework. I never did follow up on what became of Zend Framework, but that too is stunningly complex and at least back when I used it, did not work as expected due to numerous bugs and very poor documentation.

Bob


Viewing all articles
Browse latest Browse all 2

Trending Articles