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 (português, ruby on rails) by ontonho

Existem muitos plugins ótimos para fazer upload de arquivos em Rails, entretanto, é possível fazer isso de uma forma bastante simples, passo a passo. Read the rest of this entry »

(2) 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 10-10-2008
Filed Under (português, ruby on rails, search engine) by David William

Neste post eu gostaria de mostrar como usar Sphinx através do plugin Ultrasphinx.

Eu escrevi outro post sobre o básico que você precisa saber sobre Sphinx. Se Sphinx é algo realmente novo pra você, eu recomendo que você leia o post antes de continuar.

Primeiro, uma rápida explanação sobre Sphinx:

Sphinx é um mecanismo de busca full-text. O objetivo princial é prover uma busca boa e rápida com uma série de opções para aumentar a relevância dos resultados.

A distribuição inclui quatro programas: indexer (para criar índices fulltext), search (para consultar índices fulltext a partir da linha de comando), searchd (um daemon para pesquisar índices fulltext a partir de softwares externos - o caso mais comum) e sphinxapi (um conunto de bibliotecas API).

Read the rest of this entry »

(2) 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 (interface, português) by David William

Hoje eu gostaria de falar sobre algo que encontrei quando estava procurando informações sobre integração javascript com um projeto com o qual estou trabalhando. Trata-se do MoreCSS. Um jeito simples de integrar os elementos javascripts mais comuns em uma página web.

“Imagine que criar popups, tab menus ou tooltips pode ser tão fácil e confortável quanto escrever alguns estilos em CSS…” (É o que a página do projeto diz para capturar os seus olhos…)

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 (português, ruby on rails) by ontonho

No último post eu mostrei como criar uma fixture em YML a partir de um arquivo Excel de uma maneira extremamente difícil.

Agora já sei como fazer isso de forma muito mais fácil, basta salvar o arquivo no formato CSV (Comma Separated Values - Valores separados por vírgula). O melhor de tudo é que o próprio excel é capaz de fazer isso.

Depois disso, com o Arquivo CSV pronto, basta salvá-lo na pasta “test/fixture” (”fixture tests” no NetBeans) do projeto rails. Em seguida, basta dar os comandos:

>> rake db:fixture:load

pronto, o banco de dados está populado.

Só é necessário lembrar que, no arquivo Excel, a primeira linha deve conter os nomes dos campos correspondentes. As outras linhas devem conter os dados. Exemplo:

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

Olá a todos. Nesse post mostrarei uma das formas de fazer seu aplicativo Rails tocar músicas mp3 numa página. A idéia é simples: usaremos um player flash que apontará para um arquivo mp3 já salvo em disco. Como fazer upload desse arquivo está fora do escopo desse post.

Um bom player flash, open source, leve e bastante customizável pode ser encontrado em (http://flash-mp3-player.net/). Eu baixei a versão MAXI pelo número de configurações ofertadas, mas fiquem a vontade. O funcionamento das versões são iguais. Qualquer uma delas recebe flashvars para encontrar o endereço da música.

Read the rest of this entry »

(3) Comments    Read More