<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dica1 &#187; HTML</title>
	<atom:link href="http://www.dica1.com.br/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dica1.com.br</link>
	<description>A melhor dica da internet.</description>
	<lastBuildDate>Thu, 02 Sep 2010 17:52:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>pt</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Utilizando o form Select do Ruby on Rails</title>
		<link>http://www.dica1.com.br/utilizando-o-form-select-do-ruby-on-rails/</link>
		<comments>http://www.dica1.com.br/utilizando-o-form-select-do-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 02:44:28 +0000</pubDate>
		<dc:creator>Luanildo Silva</dc:creator>
				<category><![CDATA[DICA1]]></category>
		<category><![CDATA[Ruby on rails]]></category>
		<category><![CDATA[codigo]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Metodologias Ágeis]]></category>

		<guid isPermaLink="false">http://www.dica1.com.br/?p=76</guid>
		<description><![CDATA[Pesquisei em vários sites, tentando descobrir como criar um Select Box em Ruby on Rails, com as opções já predefinidas. Encontrei materiais, mas nenhum atendia a minha necessidade.

A maioria mostrava como preencher as opções do Select, buscando as informações do Banco de dados e alguns chegavam perto do que eu queria, mas não funcionava ou [...]<p>Post from: <a href="http://www.dica1.com.br">Dica1</a></p>
<p><a href="http://www.dica1.com.br/utilizando-o-form-select-do-ruby-on-rails/">Utilizando o form Select do Ruby on Rails</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Pesquisei em vários sites, tentando descobrir como criar um Select Box em Ruby on Rails, com as opções já predefinidas. Encontrei materiais, mas nenhum atendia a minha necessidade.</p>
<p><img src="http://www.dica1.com.br/wp-content/uploads/2009/07/lab2.jpg" alt="Pesquisa" title="Pesquisa" width="600" height="259" class="aligncenter size-full wp-image-143" /></p>
<p>A maioria mostrava como preencher as opções do Select, buscando as informações do Banco de dados e alguns chegavam perto do que eu queria, mas não funcionava ou eu não consegui fazer funcionar.</p>
<p>Quando já estava desistindo de procurar, encontrei o trecho de código que eu tanto procurava, fiz algumas adaptações e funcionou bonitinho.</p>
<p>Esta dica é para ajudar a vocês que estão tendo a mesma dificuldade que eu tive.</p>
<p>Neste exemplo estou preenchendo o Select Box com as siglas dos estados brasileiros. Sendo que eu quero que a sigla seja mostrada no Select da mesma forma que vai ser inserida no banco.</p>
<select name="estado">
<option value="AL">AL</option><br />
<option value="AP">AP</option><br />
<option value="AM">AM</option><br />
<option value="BA">BA</option><br />
<option value="CE">CE</option><br />
<option value="DF">DF</option><br />
<option value="ES">ES</option><br />
<option value="GO">GO</option><br />
<option value="MA">MA</option><br />
<option value="MT">MT</option><br />
<option value="MS">MS</option><br />
<option value="MG">MG</option><br />
<option value="PA">PA</option><br />
<option value="PB">PB</option><br />
<option value="PR">PR</option><br />
<option value="PE">PE</option><br />
<option value="PI">PI</option><br />
<option value="RJ">RJ</option><br />
<option value="RN">RN</option><br />
<option value="RS">RS</option><br />
<option value="RO">RO</option><br />
<option value="RR">RR</option><br />
<option value="SC">SC</option><br />
<option value="SP">SP</option><br />
<option value="SE">SE</option><br />
<option value="TO">TO</option></p>
</select>
<p><strong>O Código em Ruby on rails fica assim:</strong></p>
<div class="codecolorer-container rails twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="rails codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#CC0066; font-weight:bold;">select</span> <span style="color:#ff3333; font-weight:bold;">:estado</span>, <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;AC&quot;</span>, <span style="color:#996600;">&quot;AC&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;AL&quot;</span>, <span style="color:#996600;">&quot;AL&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;AP&quot;</span>, <span style="color:#996600;">&quot;AP&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;AM&quot;</span>, <span style="color:#996600;">&quot;AM&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;BA&quot;</span>, <span style="color:#996600;">&quot;BA&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;CE&quot;</span>, <span style="color:#996600;">&quot;CE&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;DF&quot;</span>, <span style="color:#996600;">&quot;DF&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;ES&quot;</span>, <span style="color:#996600;">&quot;ES&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;GO&quot;</span>, <span style="color:#996600;">&quot;GO&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;MA&quot;</span>, <span style="color:#996600;">&quot;MA&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;MT&quot;</span>, <span style="color:#996600;">&quot;MT&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;MS&quot;</span>, <span style="color:#996600;">&quot;MS&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;MG&quot;</span>, <span style="color:#996600;">&quot;MG&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;PA&quot;</span>, <span style="color:#996600;">&quot;PA&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;PB&quot;</span>, <span style="color:#996600;">&quot;PB&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;PR&quot;</span>, <span style="color:#996600;">&quot;PR&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;PE&quot;</span>, <span style="color:#996600;">&quot;PE&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;PI&quot;</span>, <span style="color:#996600;">&quot;PI&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;RJ&quot;</span>, <span style="color:#996600;">&quot;RJ&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;RN&quot;</span>, <span style="color:#996600;">&quot;RN&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;RS&quot;</span>, <span style="color:#996600;">&quot;RS&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;RO&quot;</span>, <span style="color:#996600;">&quot;RO&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;RR&quot;</span>, <span style="color:#996600;">&quot;RR&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;SC&quot;</span>, <span style="color:#996600;">&quot;SC&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;SP&quot;</span>, <span style="color:#996600;">&quot;SP&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;SE&quot;</span>, <span style="color:#996600;">&quot;SE&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;TO&quot;</span>, <span style="color:#996600;">&quot;TO&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></div></td></tr></tbody></table></div>
<p><strong>Quando é visualizado em HTML fica desta forma:</strong></p>
<div class="codecolorer-container html4strict " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/select.html"><span style="color: #000000; font-weight: bold;">select</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;estado&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;AL&quot;</span>&gt;</span>AL<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;AP&quot;</span>&gt;</span>AP<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;AM&quot;</span>&gt;</span>AM<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;BA&quot;</span>&gt;</span>BA<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;CE&quot;</span>&gt;</span>CE<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">option</span></a>&gt;</span><br />
...<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/select.html"><span style="color: #000000; font-weight: bold;">select</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p><strong>Este exemplo é Rails Básico, faz parte dos meus estudos.</strong><br />
Espero que seja útil!</p>
<p>Post from: <a href="http://www.dica1.com.br">Dica1</a></p>
<p><a href="http://www.dica1.com.br/utilizando-o-form-select-do-ruby-on-rails/">Utilizando o form Select do Ruby on Rails</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dica1.com.br/utilizando-o-form-select-do-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Você sabe o que é CSS?</title>
		<link>http://www.dica1.com.br/voce-sabe-o-que-e-css/</link>
		<comments>http://www.dica1.com.br/voce-sabe-o-que-e-css/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 21:01:42 +0000</pubDate>
		<dc:creator>Luanildo Silva</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[DICA1]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Folha de Estilo]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Maujor]]></category>

		<guid isPermaLink="false">http://www.dica1.com.br/?p=23</guid>
		<description><![CDATA[

Você sabe o que é CSS?
 Ainda existem internautas que não sabem. CSS (Cascading Style Sheets) ou Folha de Estilo em Cascata.

O CSS basicamente define as cores, estilo e posicionamento de imagens e diversos outros elementos que compõem um site ou blog. O CSS influi directamente no design das paginas modificando de maneira prática o [...]<p>Post from: <a href="http://www.dica1.com.br">Dica1</a></p>
<p><a href="http://www.dica1.com.br/voce-sabe-o-que-e-css/">Você sabe o que é CSS?</a></p>
]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-5200520663494785";
/* 468x60, criado 04/01/09 */
google_ad_slot = "8820205483";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<div id="texto"><strong>Você sabe o que é CSS?</strong><br />
 Ainda existem internautas que não sabem. <strong>CSS (</strong><strong>Cascading Style Sheets)</strong> ou Folha de Estilo em Cascata.</p>
<p><img class="aligncenter" style="border: 0pt none; vertical-align: middle;" src="http://lh5.ggpht.com/_h8gtMaR5te0/SWEg_TEKvDI/AAAAAAAAA2g/cfRv3Fa_q9k/s800/css.jpg" alt="Css" width="508" height="379" /></p>
<p>O CSS basicamente define as cores, estilo e posicionamento de imagens e diversos outros elementos que compõem um site ou blog. O CSS influi directamente no design das paginas modificando de maneira prática o seu visual.</p>
<p>Meu interesse aqui não é ensinar CSS, pois já existem muitos sites e blogs que dispõem de conteúdos de qualidade sobre o assunto. Vou listar dois sites que merecem uma atenção especial não só por seu conteúdo, mas também pela forma como ele está bem estruturado e organizado.</p>
<p><a class="external text" title="http://www.maujor.com/" rel="nofollow" href="http://www.maujor.com/">Maujor &#8211; Tutoriais CSS</a><br />
 <a class="external text" title="http://pt-br.html.net/tutorials/css/introduction.asp" rel="nofollow" href="http://pt-br.html.net/tutorials/css/introduction.asp">HTML.net &#8211; Aprenda CSS</a></p>
<p>Para que vocês tenham uma ideia do poder do CSS recomendo que visitem o site <a title="Site Zen Garden sobre CSS" xml:lang="en" href="http://www.csszengarden.com/tr/portuguese/">Zen-Garden.</a> É surpreendente como o CSS transforma a aparência de um site.</div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-5200520663494785";
/* 468x60, criado 05/01/09_postagem */
google_ad_slot = "8074229703";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>Post from: <a href="http://www.dica1.com.br">Dica1</a></p>
<p><a href="http://www.dica1.com.br/voce-sabe-o-que-e-css/">Você sabe o que é CSS?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dica1.com.br/voce-sabe-o-que-e-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
