Archive for the ‘Ruby On Rails’ Category
Wednesday, November 12th, 2008



At long last Microsoft have announced publically the excellent SPDisposeCheck tool.   This tool will examine your IL level components and report any possible areas where you may have the potential for a leak due to objects not being disposed of correctly.   The output from the tool does require a deep understanding of the way objects are disposed of as there is the potential for false positives.

For more information check out the SharePoint Team Blog even if you can’t get the tool just yet, its coming soon, the referenced posts are a must read for all SharePoint developers.

Sunday, February 4th, 2007



I have to confess that I am still doing my Rail development on Windows (see SoftiesOnRails.com for a decent forum and posts on this. However the article Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X by Dan Benjamin should spurn me to get my home iMac Rails development environment going.

Saturday, January 20th, 2007



If your into Rails you probably have this but worth repeating for the efforts put in by the rails community.

Rails 1.2: REST admiration, HTTP lovefest, and UTF-8 celebrations

Tuesday, January 16th, 2007



I have recently upgraded the MySQL gem to resolve ‘lost connection’ issues all appeared to work (I’m using MySQL v5 on XP running MySQL as a service). However this evening I needed to do some database migration which presented me with an error
“The procedure entry point mysql_stmt_row_tell could not be located in
the dynamic link library LIBMYSQL.dll.”

I have ‘goggled’ this but nothing out there to explain the reason. I did however check the state of the database and it has been migrated correctly. I shall be monitoring it going forward, if you have a solution please comment. Updates will be added to this post when I find the solution.

Update
Fixed: Added the path to the MySQL bin directory
C:\Program Files\MySQL\MySQL Server 5.0\bin

Monday, December 18th, 2006



John Nunemaker, at RailsTips.org has posted a really cool article to help with your Ruby seaches Finding Help Fast!.

Wednesday, December 13th, 2006



Martin Lindhe has a good article on installation and configuration of Subversion (SVN) 1.4.0 in Windows. Having installed and played with Subversion and TortoiseSVN, the windows client to Subversion, I can say that I am more than impressed. Quick, simple and easy to use yet it has lots of advanced features for the more complicated projects or processes.

 

Sunday, December 10th, 2006



..continued from part 3

Section 9 Playtime – Page 139

The last task is to add a link to each item and remove it from the cart. It is suggested that you do this in a non-Ajax way first and then add the Ajax and the example on http://wiki.pragprog.com/cgi-bin/wiki.cgi/PT-D-4 covers this in detail however I found the following problems.

Not working in JavaScript disabled browser

<td>

<%= link_to_remote “remove”, :url => { :action => :remove_from_cart , :id => cart_item.product} %>

</td>

This line renders the link as an onclick event which will not work if javascript is disabled. This may be a bug in my version of Ruby on Rails where the href=”#” should render the link if javascript is disabled.

<a href=”#” onclick=”new Ajax.Request(’/store/remove_from_cart/2′, {asynchronous:true, evalScripts:true}); return false;”>remove</a>

To resolve this issue I replaced this with

<% form_remote_tag :url => {:action => :remove_from_cart, :id => cart_item.product } do %>

    <%= submit_tag “remove” %>

<% end %>

This produces a form similar to the ones used for the Index.rhtml

If using JavaScript the redirect_to_index will not work, this is because the form_remote_tag (or link_remote_tag) enable XHR request which will not force a redirect of the main browser. This should be written as form_tag (or link_tag) to work without Ajax and updated to use remote once the remove_from_cart.rjs has been created. Generally you will tend to write this in the finished format now that you know how the remote calls work.

 

Friday, December 8th, 2006




continued in part 4…

.. continued from part 2

Iteration D3: Highlight Changes

This error had me stumped for a while, although it did force me to read through and really understand how the code was working. Something I have found a little difficult in Ruby is the debugging. Coming from a .Net background we have been spoilt with the debugging capabilities of Visual Studio, sometimes to the determent of knowing what is actually going on.

The error occurs when added a new product to the Cart. You get two dialog boxes the first gives “RJS Error: [Object Error]” followed by “Element.update(”cart”, …” this error showed the correctly rendered HTML that was inserted into the cart after clicking ok.

The “Highlight” effect was also missing from the cart item. Reason the <tr> tag for the cart item did not have the id <tr id=”current_item”> However the logic here look sound as the highlight did work for adding additional items of existing products. The problem must therefore be in the Cart.rb file which handles the add_product method.

The line @items << CartItem.new(product) should read @items << current_item = CartItem.new(product)

This assigns the newly created cart item to the current_item variable which is in turn added to the cart items.

Friday, December 1st, 2006



First Impression

Wow! That was easy!

After doing the normal Google -> Review -> Google some more process I was left with a long list of things to look at and also some other examples of people who have been down the same path. All of the development was completed on Windows XP SP2 (except the deployment to Linux which was running under VMWare).

  1. Install Instant Rails – This will get you up and running in no time, you don’t need to know anything about Rails or Ruby at this pointOne thing that you will notice if moving from the .net world is that you don’t need to compile it
  2. Read the Instant and follow the short tutorials, this is in the help\index.html directory where you installed Instant Rails
    1. Tutorial 1 - OnLamp.com
    2. Tutorial 1 - OnLamp.com
  3. Consider an Editor – I used RadRails but I’m still looking for something more…
  4. Watch the Screencasts to get a feel for what you should could do and how quickly (once you know Ruby)At this point you may want to purchase a Mac so that you can use the cool TextMate. I have already requested a Mac Book Pro as my next Laptop J
  5. Copy the code, but hand craft it to complete the Putting Flickr on Rails screencast
    This will help you find your way around the environment, debug the application (you will get an Invalid Key error, tip ‘look at the Flickr gem code initialization’)
  6. Purchase the book Agile Web Development with Rails, the second edition is out and fully up to date with version 1.2 of Instant Rails. The book details how to get the vendor version if it is not released yet. This is a really easy book to read, very well written and really does make a difference.
  7. If you enjoy reading and want something a little off the wall you could try Why’s (Poignant) Guide to Ruby, I have found this funny, but difficult to get into – but the Foxes did get the Chunky Bacon into the samples (you need to read it for that one J)
  8. Update Use source control - Subversion will do the trick
  9.  

Subscribe to some feeds Planet Ruby On Rails, Loud Thinking - David Heinemeier Hansson

Going forward I’m looking at improving my html development, I need to stop using tables!, I need to improve my JavaScript (http://script.aculo.us/ ) and I am looking at Unbuntu, MySQL, SQLLite, Lighttpd, Mongrel to name but a few.

Exciting times!

 

 

 

 

Thursday, November 23rd, 2006



Having developed software on the Microsoft platform since VB3 and before I have always like the way that as a developer things just worked, you click install and it does it all. I did flirt with Java before .Net came along; Java had a buzz and was moving on from the then VB6 solutions (and Visual Interdev was just horrible for ASP development).

My traversal into the world of Java was to be short lived, at the time Google had not been conceived and information, blogs and knowledge sharing online just did not happen. I failed miserably at the first hurdle trying to setup my development environment! The need for various versions of each separate component available from different sources was a mile away from the Microsoft bubble that I was used to. I ended my look at Java without even completing the ‘Hello World’ application L.

Now many years later and happily coding in the world of .Net (now in its version 3 flavour) I am starting to look fondly at the open source market again. This had crept up on me as I had started to bring Nant, Ndoc, CruiseControl and other open source products into my previously Microsoft only toolbox. This time my expedition is part of a project we are doing internally that we have the adopted the mantra ‘Embrace Open Source’. We have others this is the only one relevant to this blog posting!. Having done some research we are starting to settle on evaluation of Ruby, more specifically Ruby on Rails. It appears many other developers have gone down or are going down the Microsoft by day, Ruby on Rails by night - and the weekend and sometimes at work – just don’t tell the client!. One example is Netter-on-Rails.

Tomorrow will hopefully be a seminal moment in my software evolution, my thoughts views and progress will appear here to all those 1 or 2 readers that have found this blog J.