Posted on 10-10-2008
Filed Under (inglês, ruby on rails) by Rafael Uchôa

Yes, by a very, very simple way! First of all, you don’t need to worry about document’s layout, you will use your own View! Let’s see how.

Before anything, you need to install a command-line program that can convert any XML to PDF, called Prince XML. The program is distributed under a free license and can generate PDF files based on XHTML with CSS applied. See the site for more details.

Read the rest of this entry »

(0) Comments    Read More   
Posted on 10-10-2008
Filed Under (inglês, ruby on rails) by ontonho

There are many good plugins to upload files in Rails, but it is possile to do it by a simple way. I will show it step by step. Read the rest of this entry »

(0) Comments    Read More   
Posted on 10-10-2008
Filed Under (inglês, ruby on rails, search engine) by David William

In this post I would like to share how to use Sphinx through the Ultrasphinx plugin.

I wrote another post about the basic things you should know about Sphinx. If Sphinx is something real new for you, I highly recommend you read it before continue.

First, a quick explanation about Sphinx:

Sphinx is a full-text search engine. The main goal is to provide good and fast search with a lot of options to increase the results’s relevance.

The distribution includes four programs: indexer (to create fulltext indices), search (to query fulltext indices from command line), searchd (a daemon to search through fulltext indices from external software - the most common case) and sphinxapi (a set of API libraries).

Read the rest of this entry »

(0) Comments    Read More   
Posted on 08-10-2008
Filed Under (inglês, interface) by David William

Today I would like to talk about something I found when I was looking for some javascript integration with the project I’m working. It’s MoreCSS. A simple way to integrate the most common javascript elements in a web page.

“Imagine creating pop-ups, tab menus or tool-tips could be as easy and comfortable as writing some styles in CSS…” (Is what the project page says to catch your eyes)

Read the rest of this entry »

(0) Comments    Read More   
Posted on 08-10-2008
Filed Under (inglês, ruby on rails) by ontonho

Last post I showed how to create a YML Fixture from a Excel file in what i consider the hard way.

Now I’ve learned how to do it in a easier way. I have just to transform it as a CSV file. The good news is that Excel can do it for us.

After save the CSV file, I can copy it to the test/fixture folder (”Fixture tests” in netbeans) on a rails project.

Then, I need just run the command:

>> rake db:fixture:load

It is done! Database is populated.

Just remember that the first row of the XLS file should contain the name of fields and the other rows shall contain data. For example:

name phone
jonh 1234-1234
jack 1234-5678
(0) Comments    Read More   
Posted on 08-10-2008
Filed Under (inglês, ruby on rails) by Rafael Uchôa

Hi everyone. In this post I’ll show a way of making your Rails application play MP3. The idea is simple: use a flash player pointing to an mp3 file already saved on server side. Uploading the file is outside the scope of this post.

A nice flash player, open source, lightweight, highly customizable can be found at http://flash-mp3-player.net/. I downloaded the “MAXI” version because of the number of configurations, but you can choose among others. Any one of them use flashvars to get the address of the music.

Read the rest of this entry »

(0) Comments    Read More   
Posted on 07-10-2008
Filed Under (inglês, search engine) by David William

I’m working in a new web project using database, which needs a good search engine. Since there are many records and the database must get larger, there’s no doubt the search performance is a critical mission.

I have to admit that I always contented myself using resources such as views, stored procedures, scripts, including database settings to promote a better query performance. However, after an indication of a friend, I found Sphinx. Here, I want to share a little of this search engine that may be the perfect solution for whoever needs high performance working with complex searches, with a huge amount of data.

Read the rest of this entry »

(2) Comments    Read More   
Posted on 07-10-2008
Filed Under (inglês, ruby on rails) by Rafael Uchôa

I’m really excited with the power of Ruby on Rails. Increasingly I find tools that expedite the software development. My most recent discovery was the bare-bone BaseApp. Bare-bones are Rails projects ready to use, with a set of standard features and plug-ins which were already configured, in the best style of DRY (Do not Repeat Yourself!). Tedious tasks such as control of users and page of listings are all ready!

Read the rest of this entry »

(0) Comments    Read More