A place for opinions and notes of a valibuk.

WordPress 2.1 And Blogroll

Tagged with: — ondrej at 11:55 pm on Sunday, February 4, 2007

Today I upgraded to a newer version of WordPress 2.1. And my theme, based on the Dixie Belle theme, showed an error in the sidebar:

  1. WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1]
  2. SELECT cat_id, cat_name FROM

(There is more where this came from … )

How To Handle Model In Module?

Tagged with: — ondrej at 10:53 pm on Sunday, February 4, 2007

Ruby on RailsThe number of models in your Ruby on Rails application is growing and one day you will get a brilliant idea.. Let’s put them to modules (that is to different subdirectories in the modules directory). Well, I had this day some weeks ago and, honestly, it is not a good idea… Helpers and tools in RoR, that work without any problems and manual changes when models do not use modules, will require some manual changes to work.

(There is more where this came from … )

One Model With acts_as_list and acts_as_tree

Tagged with: — ondrej at 8:49 pm on Sunday, February 4, 2007

Ruby on Rails Ruby on Rails provides nice ways to create a list (acts_as_list), that is to keep order of items, and to create a tree (acts_as_tree), that is to organise items with parent–children relationships. But what to do, if you need both functionalities at once?

My model has name Outline and it holds one textual information.

(There is more where this came from … )

Rails, Capistrano, Mongrel and Apache (with SSL) on Gentoo

Tagged with: — ondrej at 2:25 am on Monday, January 8, 2007

Ruby on Rails
There is a happy occasion in the development of an application — deployment. Users will use it, you will receive (hopefully) some money, there will be some bugs.. well, maybe not so happy occasion.. ;>
In most situations you will have to repeat a deployment process several times (bug fixes, new features, etc.). Maybe the process is not very complicated, but an automation will minimise possible mistakes such as typos or omitted commands.
Fortunately, there is a nice tool for Ruby on Rails applications — Capistrano.

Larry the CowNow we know about a tool to automate the deployment of an application, but we need to deploy our application to a production environment — I decided for the combination of Mongrel and Apache.

…and everything runs on Gentoo :)

Let’s start — here is my short howto:
(There is more where this came from … )

Preparing photos for a web photo album

Tagged with: — ondrej at 12:02 am on Monday, October 30, 2006

A few tips how to prepare photos for a web photo album:

  1. Make a copy of the picture that you would like to have on web. The following steps include instructions that will irreversibly change your photos.
  2. (There is more where this came from … )

Ruby, DRb and Gentoo

Tagged with: — ondrej at 5:36 pm on Friday, October 27, 2006

Larry the CowThere can be a problem with the DRb system in Ruby on Gentoo and the IPv6 support.

If an application with DRb does not work and its error message is:

  1. Exception `SocketError’ at /usr/lib/ruby/1.8/drb/drb.rb:840 – getnameinfo: ai_family not supported
  2. /usr/lib/ruby/1.8/drb/drb.rb:840:in `getaddrinfo’: getnameinfo: ai_family not supported (SocketError)

then it is necessary to re-compile the ruby package with the ipv6 support, even you did not compile the IPv6 support into your kernel (or it is compiled as a module but it is not loaded).
(There is more where this came from … )

Distributed Ruby

Tagged with: — ondrej at 5:26 pm on Friday, October 27, 2006

I am creating a prototype of a distributed application written in Ruby. Ruby 1.8 already contains the DRb framework, as a system for a communication of different Ruby processes, and the Rinda system too, as a naming service.
(There is more where this came from … )

Podpora slovenčiny i s triedením v PostgreSQL a Ruby on Rails

Tagged with: — ondrej at 5:33 pm on Friday, October 13, 2006

Ruby on RailsAk používate PostgreSQL databázu a radi by ste slovenké písmenká i triedenie mali, nasledujúci návod vám k tomu pomôže.

Keďže používam Gentoo distribúciu, uvediem aj kroky potrebné pre úspešné používanie slovenčiny na tejto distribúcii.

A ako posledné si ukážeme, ako to všetko použiť v Ruby on Rails.
(There is more where this came from … )

Removing constraints in migration

Tagged with: — ondrej at 7:44 pm on Wednesday, October 4, 2006

Ruby on RailsWith a migration you can create a table or insert data to a table, also there is a possibility to modify existing tables; from renaming tables to changing the type of a column. And what about constraint such as default value or not null?

Yeah, you can change them too, but I was only successful with adding them — removing them was not possible with standard Rails methods.
(There is more where this came from … )

Observing more fields with AJAX helper and Unicode

Tagged with: — ondrej at 11:01 pm on Monday, October 2, 2006

Ruby on RailsIn my post about using the observe_field helper for observing more fields I used the escape method (on the client side).

I have found out the code does not work correctly with Unicode characters :(
(There is more where this came from … )

« Previous PageNext Page »