Noobs helping Noobs

I have recently got on IRC. I've been on the #rubyonrails for a few days. I, a rails noob, has even managed to help a few other noobs. One problem I helped with, seems to have something to do with strange characters in your file, you get some strange error about \\034 character (or something really weird) -- I found it by pasting my code into windows notepad and finding some strange unprintable character. I had copy/pasted I think some content from word (smacks head).

I'm starting to learn enough RoR to no longer feel like a poser at the next ruby meeting...which by the way, Jim Weirich, creator of Rake is going to speak... and... I also found a podcast yesterday with him.... AND one about Selenium (whoo hoo!):

Jim Weircih, Ruby on Rails Podcast (mp3)

QA Podcast - Selenium

I also got the pleasure of meeting (over IM) Ian Langworth, author of Perl Testing - A Developers Notebook. Andy Lester hooked us up in group IM chat. Very cool. :)

Pretty cool...


Don't QUOTE rails...

Apparently, "quote" is a reserved word. I had a database field with that name. I was getting a strange error ...

wrong number of arguments(2 for 0)

HUH? RoR is keeping score on me? who's winning??

Upon searching google, I found this post..

hmm.. so I checked the lis of reserved words...

Rails Doc on this: http://dev.rubyonrails.org/ticket/3628

SO let that be a lesson kids..


Rails Security or Why Can't all Code be Perfect?

I was a bit alarmed (thats what happens before Cup of Coffee #2 to read this post:

WebObjects VS. Ruby

I hadn't thought of some of those things before. I have wondered though, what things would a paranoid security person have to say about Rails. So I posted to a RoR mailing list to see what they thought (forgive the ill named initial post, another side affect of doing something before Cup of Coffee #2)


I've come to the conclusion that RoR would be no more insecure than using PHP and blindly using the _GET and _POST variables without validating them first.

I do not know anything about Ruby's taint mode and why its not turned on in Rails (not that I'm blaming Rails authors for anything) and the Rails developers may have made the decision to leave it up to the programmers.

[ RANT ]
Programmers need to take responsibility and not blame frameworks for insecure code, especially if the programmer can go look at the code for themselves. I've heard people bellyache about PEAR classes not checking input. Well, thats the programmers job and PEAR doesn't claim to do stuff like that either! What moron would pass code to code she or he didn't write without first checking the variables? Unfortunately, probably alot. But I'm not one of them and I'm not goint to sit around a gripe about it either.
[ /RANT ]

Found some docs:
Securing your Rails application

Choo Choo at last

Finally got RoR working on my laptop, I don't know how it worked before then stopped, but if I put use a user with no password it works fine. Something with the drivers I think for MySQL. But no matter, it works. I got subversion to work on my new webhost RailsPlayground.com and everythins is awesome! I can work on my laptop.. get home.. check in... check out on site. Awesome. I'm very happy.


Rails and Instant De-Rails

Thanks for the input on the Rails hosting and my Ruby question. I also got a response from the Chicago group which you can see in the archives here if you are interested.. I decided to go with different controllers since I will probably add more funtionality to the products section later.

I got an account at RailsPlayground.com. Joe was very nice in getting me setup and answering a few questions. I can't host my husbands "TeamSpeak" linux app on there since its just for web hosting.. but thats ok for now.

I installed InstantRails for my windows machine to work on..since I have 3 hour commute a day where I can work on my laptop. I got it working fine, the I was getting this error when I did scaffolding:

script/generate scaffold photo
exists app/controllers/
exists app/helpers/
exists app/views/photos
exists test/functional/
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
identical app/models/photo.rb
identical test/unit/photo_test.rb
identical test/fixtures/photos.yml
error Before updating scaffolding from new DB schema, try creating a tab
le for your model (Photo)
Grrrrrrrrrr...... so I updated to the latest Instant Rails. Same thing. I googled, only thing I could find is it can't connect to the DB (is it so hard to check that first and just say cannot connect?) so I double checked the password, use OLD_PASSWORD to set the password, tried NO password. Same thing.

I went to script/console and tried to create a new Photo and it say something about show fields * from photos error. Ok, well thats what I had before I even used InstantRails.

On the bright side today... the mangement company for the building I work gave all the female employees a rose for Valentines Day. Its nice.

Anybody have any ideas?

Edit: Updated the link for RailsPlayground.com ... sorry! I don't know why I put RailsHosting! doh!


Rails Question

I posted this to the Chicago Ruby Users Group, but no response yet. Maybe one of the two readers of thie blog have some advice:

I'm working on a small project (5 major pages, 1 with 4 linked off, 1 with 3
linked off) and I was going to just do it all in flat html files with
dreamweaver templates (yeah, I was being kinda lazy). I got the sigle page
sections done and find out, it would really be nice to do this page in with
a database (list of new products). So I thought, hey maybe this is a good
use for rails (don't laugh! I'm desperate for an excuse).

About 1 hour I had my dreamweaver pages put into a rails project with the
layout.rhtml and the contents broken out into template files. I was nearly
giggling with joy.

I made a Page controller with these actions: index, about, contact, products
and information.

products and information needs a sidebar menu, so in those methods I
specified the name of the template to render :partial=>@submenu

I used that method for the information section which contained 3 pages.

Then I come to the product section, which has 4 sections and I did the same
thing. It worked.

(so far no database interation)

Then I thought, maybe the better design was to create a Product controller.
So I did. I set the submenu template name in the initialize method, and told
it to use layout "Page" I tweaked the link in the layout/page.rhtml to call
the Product controller. It worked.

Which is the better way or are both ways stupid and you have a better one?


New Webhost

I'm looking for a new web host HiVelocity won't fix the
problem with me emailing AOL. I want to have access as root(or a tech support that will
assist me when I want to make changes), at least 20 some domains (none very high traffic).
I need PHP, MySQL, Ruby, Rails, Python and Perl.

I want to spend around 40-70 a month.

I've been recommened to Dreamhost and I've been
looking at RailsPlayGround.

Any suggestions?


I love it

I love it.

Thats all I can say.


MakinDo 0.1

I had a brilliant idea today. I tried to get a client to consider RoR and got the expected response. Hey, I'll make a Framework called "Makin' Do" here's a list of features I've come up with so far:

  • PHP 4.0
  • MySQL 3.17
  • No Pear
  • Does not include any ridiculous testing apparatus (who needs it anyways?)
  • No template system needed
  • Database migration tools? that’s a self-service feature, best way is to just keep it in your brain, then you don’t need to worry about backing it up.
  • Mixes PHP and HTML saves on the number of files you need. Less files you have the better.
  • Uses extremely long file names, that way you can tell what's in the file without even opening it example ("/department/officemanagement/administration/catalog/springCatalogUpdatePage.class.php")
  • Design patterns make it hard for mere mortals to understand, therefore you will not find any in this framework.
  • Uses PHP Globals. Less typing then instead of hammering out $_POST, $_REQUEST, and $_GET

So how bout it?? did I miss anything??

And I think I will even make it a commercial product, since this is just the sort of things corporations dig!

There. I feel better 