<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5165138530817586147</id><updated>2024-11-01T07:54:24.886-03:00</updated><category term="rails"/><category term="ruby"/><category term="RoR"/><category term="controller"/><category term="many-to-many"/><category term="model"/><category term="view"/><category term="agilebahia"/><category term="agilidade"/><category term="area1"/><category term="autenticação"/><category term="authlogic"/><category term="belongs_to"/><category term="cabeça"/><category term="combo"/><category term="crud"/><category term="ekaaty"/><category term="filtros"/><category term="form"/><category term="generator"/><category term="has_many"/><category term="javabahia"/><category term="livro"/><category term="maré"/><category term="pesquisa"/><category term="phpba"/><category term="railsbam rails"/><category term="relacionamento"/><category term="rest"/><category term="search"/><category term="simple"/><category term="unime"/><category term="use"/><title type='text'>RailsBA</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-2797499528335907608</id><published>2010-05-21T11:56:00.001-03:00</published><updated>2010-05-21T11:58:36.780-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unime"/><title type='text'>XIII Semana de Informática BSI e CST Unime</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://sites.google.com/site/infoxiii/&quot;&gt;https://sites.google.com/site/infoxiii/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFienCU0PWDTvhuZ-omK-eOsEuw-HT0-tVivYI_izJcXoUaRPKRxsBP67RrSJ2wDlAMhHpYVLKNttPkIdjR17o0pYqWx5P45uqk-JN04eq8XFIXJHZh2nhenuPu_GyaB1WHzxy9XKJK8zs/s1600/unime.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 242px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFienCU0PWDTvhuZ-omK-eOsEuw-HT0-tVivYI_izJcXoUaRPKRxsBP67RrSJ2wDlAMhHpYVLKNttPkIdjR17o0pYqWx5P45uqk-JN04eq8XFIXJHZh2nhenuPu_GyaB1WHzxy9XKJK8zs/s400/unime.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5473737615102634034&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/2797499528335907608/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2010/05/xiii-semana-de-informatica-bsi-e-cst.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/2797499528335907608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/2797499528335907608'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2010/05/xiii-semana-de-informatica-bsi-e-cst.html' title='XIII Semana de Informática BSI e CST Unime'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFienCU0PWDTvhuZ-omK-eOsEuw-HT0-tVivYI_izJcXoUaRPKRxsBP67RrSJ2wDlAMhHpYVLKNttPkIdjR17o0pYqWx5P45uqk-JN04eq8XFIXJHZh2nhenuPu_GyaB1WHzxy9XKJK8zs/s72-c/unime.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-1425692809108495281</id><published>2010-01-31T22:19:00.002-03:00</published><updated>2010-01-31T22:21:00.850-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="agilebahia"/><category scheme="http://www.blogger.com/atom/ns#" term="area1"/><category scheme="http://www.blogger.com/atom/ns#" term="ekaaty"/><category scheme="http://www.blogger.com/atom/ns#" term="javabahia"/><category scheme="http://www.blogger.com/atom/ns#" term="phpba"/><category scheme="http://www.blogger.com/atom/ns#" term="railsbam rails"/><title type='text'>Ekaaty Day 2010</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmQXk5ERbQ-f4ocmxapx71PFScAKYQxA7fUHXEW5IN-eMHBHm8y9I6FlZ0xt3QtM1UcSegHDISeNxW5gpJpZmyq5AFzZKv1E-8H8mgrP6F05zGVhdPoECKPQulreEgB7784rakL5wkomMx/s1600-h/programacaoekaatyday2010.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 272px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmQXk5ERbQ-f4ocmxapx71PFScAKYQxA7fUHXEW5IN-eMHBHm8y9I6FlZ0xt3QtM1UcSegHDISeNxW5gpJpZmyq5AFzZKv1E-8H8mgrP6F05zGVhdPoECKPQulreEgB7784rakL5wkomMx/s400/programacaoekaatyday2010.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5433078760747543730&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/1425692809108495281/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2010/01/ekaaty-day-2010.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1425692809108495281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1425692809108495281'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2010/01/ekaaty-day-2010.html' title='Ekaaty Day 2010'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmQXk5ERbQ-f4ocmxapx71PFScAKYQxA7fUHXEW5IN-eMHBHm8y9I6FlZ0xt3QtM1UcSegHDISeNxW5gpJpZmyq5AFzZKv1E-8H8mgrP6F05zGVhdPoECKPQulreEgB7784rakL5wkomMx/s72-c/programacaoekaatyday2010.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-1939280629638242990</id><published>2009-11-22T22:00:00.002-03:00</published><updated>2009-11-22T22:07:51.630-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="many-to-many"/><title type='text'>Tela de Cadastro com Many-to-Many - correção</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Pessoal, &lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;O Maurício Linhares (&lt;/span&gt;&lt;/span&gt;&lt;a target=&quot;_blank&quot; rel=&quot;nofollow&quot; href=&quot;http://codeshooter.wordpress.com/&quot; style=&quot;color: rgb(85, 26, 139); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;http://codeshooter.wordpress.com&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;) deu uma dica para melhorar o código do post anterior, na partial &lt;b&gt;_form.rhtml&lt;/b&gt; onde temos o nome do campo checkbox, devemos trocar d&lt;b&gt;isciplina_ids[]&lt;/b&gt; por &lt;b&gt;aluno[disciplina_ids][]&lt;/b&gt; e no controller &lt;b&gt;alunos_controller.rb&lt;/b&gt; não é necessário colocar o código &lt;b&gt;@aluno.disciplinas = Disciplina.find(params[:disciplina_ids]) if params[:disciplina_ids]&lt;/b&gt; nos métodos &lt;b&gt;create&lt;/b&gt; e &lt;b&gt;update&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Valeu Maurício pela dica!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/1939280629638242990/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/11/tela-de-cadastro-com-many-to-many_22.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1939280629638242990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1939280629638242990'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/11/tela-de-cadastro-com-many-to-many_22.html' title='Tela de Cadastro com Many-to-Many - correção'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-4354554672428854981</id><published>2009-11-20T19:22:00.021-03:00</published><updated>2009-11-20T22:52:27.103-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="controller"/><category scheme="http://www.blogger.com/atom/ns#" term="many-to-many"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="view"/><title type='text'>Tela de Cadastro com Many-to-Many</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; &quot;&gt;* Esse post foi baseado no tutorial de Jeffrey Hicks e no Railscast número 47.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;A idéia deste post é mostrar na prática como fazer um tela de cadastro havendo uma relação many-to-many. Para criar esse tutorial estou usando o Netbeans 6.7.1 e o banco de dados MySQL.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Primeiro passo é criar um projeto Rails chamado &lt;b&gt;escola&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Esse exemplo mostra uma parte do que seria um sistema acadêmico, onde eu tenho uma tabela de alunos, disciplinas e uma relação alunos por disciplina. Para trabalhar com o padrão do Rails seguiremos a convenção de nome para as tabelas e os campos.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdY534A7mdjZs0AlQFko2XIIurpAKCu-a-7OX8m8t9_uHdv5f8CSFxFHvPVkE-qgywhlUDJ-PbcedO8sf2TAB8K-iphZQKlwvqU3dO-h2WqEmrIgrhORFoBdunPEzZzG8j2iGijsGp1oqr/s1600/der.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdY534A7mdjZs0AlQFko2XIIurpAKCu-a-7OX8m8t9_uHdv5f8CSFxFHvPVkE-qgywhlUDJ-PbcedO8sf2TAB8K-iphZQKlwvqU3dO-h2WqEmrIgrhORFoBdunPEzZzG8j2iGijsGp1oqr/s400/der.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406318383115613618&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 212px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Repare que o nomes das tabelas estão no plural.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Os campos chaves são chamados de id.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;A tabela de relacionamento é na ordem alfabética.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;O campo de relacionamento é o nome da entidade no singular seguido de _id.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;O segundo passo é gerar os scaffolds para &lt;b&gt;aluno&lt;/b&gt; e &lt;b&gt;disciplina&lt;/b&gt;, abaixo mostro a tela de gerar o scaffold do Netbeans 6.7.1 para o model aluno, a mesma operação deve ser feita para disciplina (lembre-se que o nome do model deve ser no singular).&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAI8rJ35NP8zfPg-QWTWg8XvnjJg-CVW4X25sJV7AbsmLhpsR2lDqISv_p4ktqYMubaiCOd8jHFwGeGRXtAWk_flu-x9v9FhNI8qXOdxXarcrOw700pXW6RGxeXE7Mz86xVxyfYo-p7p1G/s1600/scaffold.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAI8rJ35NP8zfPg-QWTWg8XvnjJg-CVW4X25sJV7AbsmLhpsR2lDqISv_p4ktqYMubaiCOd8jHFwGeGRXtAWk_flu-x9v9FhNI8qXOdxXarcrOw700pXW6RGxeXE7Mz86xVxyfYo-p7p1G/s400/scaffold.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406319994800923378&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 289px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Altere os models aluno.rb e disciplina adicionando o método has_and_belongs_to_many conforme imagem abaixo.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-joi7VNwFHEdgLmo4JqQZZm1u9lBnVTDFfMmQy5NCG9lENe346kdFDD3GtLJXvpW7J9rPcm_RfdTvcZ6IW5lA-s8qN4zAh79LtXZXo2hfH6GhMXoyleyV9oIPGOYs4JmaEfeaOMem1unO/s1600/models.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-joi7VNwFHEdgLmo4JqQZZm1u9lBnVTDFfMmQy5NCG9lENe346kdFDD3GtLJXvpW7J9rPcm_RfdTvcZ6IW5lA-s8qN4zAh79LtXZXo2hfH6GhMXoyleyV9oIPGOYs4JmaEfeaOMem1unO/s400/models.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406321682898340738&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 210px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Essa alteração diz que disciplina tem e pertence a muitos alunos e aluno tem e pertence a muitas disciplinas. O método has_and_belongs_to_many é que faz o relacionamento n:n.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Como precisaremos de uma tabela de relacionamento, vamos criar uma migração de nome create_alunos_disciplinas para essa tabela.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR7EIp6zjtXbIslaV3QFeMLcqLKyewA9e4gL3F7ATGz_anET-JoclTxJPs5mpjO5UqKIrsKF7CtXYQrjmVTY_kOuaWMLeDCFb5eLhhxPsUvaacLa3p6Bob1smM4k_cyGc0XfHtQK1vl5Yy/s1600/migration.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR7EIp6zjtXbIslaV3QFeMLcqLKyewA9e4gL3F7ATGz_anET-JoclTxJPs5mpjO5UqKIrsKF7CtXYQrjmVTY_kOuaWMLeDCFb5eLhhxPsUvaacLa3p6Bob1smM4k_cyGc0XfHtQK1vl5Yy/s400/migration.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406323471900153378&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 289px; &quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Edite o código dessa nova migration conforme imagem abaixo:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcUCSZ34zL21uRGiIUm8WzlPgOyZSqHWGis-D21ywvzE8EI0zC0pfFwNyW2omYTF4IanGFES3jUudakx_Ui1hjQcV8wZ_msyKaUHVP-kHFUMi6Am_fjE_6GzcIc9vuxMqc7HLKR75a0RAW/s1600/migration2.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcUCSZ34zL21uRGiIUm8WzlPgOyZSqHWGis-D21ywvzE8EI0zC0pfFwNyW2omYTF4IanGFES3jUudakx_Ui1hjQcV8wZ_msyKaUHVP-kHFUMi6Am_fjE_6GzcIc9vuxMqc7HLKR75a0RAW/s400/migration2.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406367744500922770&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 224px; &quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Essa tabela não terá a chave primário id. Rode as migrations.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Para permitir que o usuário informe um aluno com várias disciplinas, vamos utilizar checkbox múltiplos. O nosso formulário será gerado dinamicamente a partir das disciplinas cadastradas no banco de dados. Nossa view vai depender do controller alunos_controller para carregar as disciplinas, altere o método &lt;b&gt;new &lt;/b&gt;e&lt;b&gt; edit &lt;/b&gt;do controller &lt;b&gt;alunos_controller.rb &lt;/b&gt;conforme imagem abaixo.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDkKWgVFsWpK7OeR4pbAmjsMsHrXN9KSPhl-bQyfeyLgpbH4y_hCKEsgEFQXRgQJja7wXex8MEzCkNoPltvivoPi2U4brPP8eCBSI5aCW8MIlzFqs9Ck1dp_OynqO_pBxGT3gapC2D4saC/s1600/alunoscontroller.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDkKWgVFsWpK7OeR4pbAmjsMsHrXN9KSPhl-bQyfeyLgpbH4y_hCKEsgEFQXRgQJja7wXex8MEzCkNoPltvivoPi2U4brPP8eCBSI5aCW8MIlzFqs9Ck1dp_OynqO_pBxGT3gapC2D4saC/s400/alunoscontroller.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406330933206971074&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 276px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;div&gt;Agora iremos customizar as views edit e new de alunos. Vamos fazer isso em um único local, ou seja, na partial _form.rhtml - para isso crie dentro de views/alunos o arquivo _form.rhtml e coloque o código abaixo.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinAnJjmK-r3jDxWgFknUxyYZsMeTpS8FE5k_WjbrfnU3AYSP_LUUkc9FaeTI4G_s4m2ZaasT4FmKR55hBnOXKdySI5UTA9iLrNGlzsYLz1KGSo_YPBcaoHfRwlOcGDLfTClRr8jVCCK29q/s1600/partial.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinAnJjmK-r3jDxWgFknUxyYZsMeTpS8FE5k_WjbrfnU3AYSP_LUUkc9FaeTI4G_s4m2ZaasT4FmKR55hBnOXKdySI5UTA9iLrNGlzsYLz1KGSo_YPBcaoHfRwlOcGDLfTClRr8jVCCK29q/s400/partial.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406344772867547250&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 293px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Nessa partial colocamos um for para carregar os checkbox com os valores e nomes das disciplinas disponibilizadas pelo objeto &lt;b&gt;@disciplinas&lt;/b&gt; que foi passado nos métodos &lt;b&gt;new&lt;/b&gt; e &lt;b&gt;edit&lt;/b&gt; do controller. Repare que o botão &lt;b&gt;f.submit&lt;/b&gt; tá com nome &lt;b&gt;button&lt;/b&gt;, esse nome é passado como parâmetro na chamada da partial nas views new e edit e o :disable_with serve para desabilitar o botão com a mensagem &quot;Aguarde...&quot; enquanto a requisição estiver ocorrendo. Abaixo o código das views alteradas, veja que na chamada da partial, passamos o parâmetro &lt;b&gt;:button&lt;/b&gt; com o texto que vai aparecer nos botões.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMIbH9ZBc8ZHYklSNJo-hJBs20rUVpazPj72Xki8JYISA3SR0NvBlcG99XpMjztchxHAm_XJopKGEXXQneBmxOCmIPkQKp1XsliGWo1YwiUkhNCSVKfVU1or4x1RVTjnW1zguiyyegFbCf/s1600/views.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMIbH9ZBc8ZHYklSNJo-hJBs20rUVpazPj72Xki8JYISA3SR0NvBlcG99XpMjztchxHAm_XJopKGEXXQneBmxOCmIPkQKp1XsliGWo1YwiUkhNCSVKfVU1or4x1RVTjnW1zguiyyegFbCf/s400/views.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406343304507438754&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 198px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Vamos alterar agora a view index de alunos para poder mostrar as disciplinas que o mesmo está associado.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZR_Mssipe7P4GjSeCQn3xm76vFWw8hjPAi2Fuvnmg5YEEnF8px6wOZs9YWBLuz44FB-GPN0dQaKV9uZqooTwyErcV2WfymleHAhxMcuy0Bo_B0HdPivGRsa31oCra2ezYPVmPgvxf82P/s1600/index.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZR_Mssipe7P4GjSeCQn3xm76vFWw8hjPAi2Fuvnmg5YEEnF8px6wOZs9YWBLuz44FB-GPN0dQaKV9uZqooTwyErcV2WfymleHAhxMcuy0Bo_B0HdPivGRsa31oCra2ezYPVmPgvxf82P/s400/index.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406346336863402082&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 370px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Os métodos &lt;b&gt;update&lt;/b&gt; e &lt;b&gt;create&lt;/b&gt; de &lt;b&gt;alunos_controller.rb&lt;/b&gt; recebem requisições das views edit e new. Para armazenar o relacionamento precisamos converter disciplinas_ids para objetos Disciplina com &lt;b&gt;Disciplina.find(@params[:disciplina_ids]) if @params[:disciplina_ids]&lt;/b&gt;. O if previne erros de objetos nulos quando o aluno não estiver associado a alguma disciplina.&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyc_ZvpWBqYXaqvWIcWP-ctS4sbMG7gnoa2qPC83OmxiqsozuQFy4FP0X6_8YpZC9pBRAoz527nZ7xv6naIPBnqOWPPKIyu0llUzwnXio3TsrCGicAzhKI7cBzKfSha-zccsxsFIzWW0IJ/s1600/controller.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyc_ZvpWBqYXaqvWIcWP-ctS4sbMG7gnoa2qPC83OmxiqsozuQFy4FP0X6_8YpZC9pBRAoz527nZ7xv6naIPBnqOWPPKIyu0llUzwnXio3TsrCGicAzhKI7cBzKfSha-zccsxsFIzWW0IJ/s400/controller.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406353018529611778&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 202px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Agora é só testar!!!!  Veja algumas telas abaixo.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; &quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZLSvk1VuHPJkfnyiKhqnPF5Js586KsBOC0HEjDJGl4MbGaMannOUIOHIUhrj7A85C1xsI8BFpxyoy17swxiYnKRm56nsxRWjh0ND7wAZTZlne4K0OGJszE7gvV5tz6ID9j9CS5_IG8zEA/s1600/telas.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZLSvk1VuHPJkfnyiKhqnPF5Js586KsBOC0HEjDJGl4MbGaMannOUIOHIUhrj7A85C1xsI8BFpxyoy17swxiYnKRm56nsxRWjh0ND7wAZTZlne4K0OGJszE7gvV5tz6ID9j9CS5_IG8zEA/s400/telas.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5406368771644323538&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 247px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/4354554672428854981/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/11/tela-de-cadastro-com-many-to-many.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/4354554672428854981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/4354554672428854981'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/11/tela-de-cadastro-com-many-to-many.html' title='Tela de Cadastro com Many-to-Many'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdY534A7mdjZs0AlQFko2XIIurpAKCu-a-7OX8m8t9_uHdv5f8CSFxFHvPVkE-qgywhlUDJ-PbcedO8sf2TAB8K-iphZQKlwvqU3dO-h2WqEmrIgrhORFoBdunPEzZzG8j2iGijsGp1oqr/s72-c/der.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-4032291895108541367</id><published>2009-11-12T19:36:00.004-03:00</published><updated>2009-11-12T19:47:29.899-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="form"/><category scheme="http://www.blogger.com/atom/ns#" term="pesquisa"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="rest"/><category scheme="http://www.blogger.com/atom/ns#" term="search"/><category scheme="http://www.blogger.com/atom/ns#" term="simple"/><title type='text'>Formulário Simples de Pesquisa</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;A idéia desse post é permitir filtrar o grid de Locadoras que está na página index.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoX_2tRgbwugsIk_QBKwSs8SN1Gjvw11XaPSpjFWxtfHgqQQDA_Uezb1v85YIxSYs6lHw7z30uI1a53CjtGizUWS4GIoXwyoxrExX4jCkquJEqfDvUxFFpgT3qPbeaBEt1I5z-mILar6dB/s1600-h/filtro01.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 112px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoX_2tRgbwugsIk_QBKwSs8SN1Gjvw11XaPSpjFWxtfHgqQQDA_Uezb1v85YIxSYs6lHw7z30uI1a53CjtGizUWS4GIoXwyoxrExX4jCkquJEqfDvUxFFpgT3qPbeaBEt1I5z-mILar6dB/s400/filtro01.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5403349923589912370&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Sabemos que a página inicial é a página index.html.erb do controller Locadoras, abra o arquivo e adicione o trecho de código destacado.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf1PnKLwYcMxxjQautGAdrFJtS0fJBVFhPvf-cqVFCBkOq7rudgCuv3X77yJDiuBZBucTfvYpvl-krXLxdiDNsixmMua58_-Rg37cG7FLUvHsBgKrRbA519_LUCggaTn3P6mR1pCvKx4Sc/s1600-h/filtro02.jpg&quot;&gt;&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf1PnKLwYcMxxjQautGAdrFJtS0fJBVFhPvf-cqVFCBkOq7rudgCuv3X77yJDiuBZBucTfvYpvl-krXLxdiDNsixmMua58_-Rg37cG7FLUvHsBgKrRbA519_LUCggaTn3P6mR1pCvKx4Sc/s400/filtro02.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5403350706064556690&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 182px; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;O helper form_tag inicia uma tag form que aponta a ação para uma url configurada com locadoras_path e método get. De acordo com métodos padrões REST, locadoras_path será substituida por /locadoras, ou seja, com o verbo get e o path /locadoras, a ação a ser executada será a index - trocando em miúdos, carregará a própria página.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;O helper text_field_tag cria um campo texto padrão, onde o primeiro parâmetro é o nome do campo e o segundo é o value - trocando em miúdos, um campo com nome :search e o valor será o próprio valor digitado quando o formulário for submetido.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;O helper submit_tag cria um botão submit padrão, onde o primeiro parâmetro é o texto que aparecerá no botão, o segundo parâmetro é um hash, que nesse caso, estamos dizendo que o botão não tem campo nome, para que não seja passado pela url. &lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;Como estamos chamando o método index, vamos alterá-lo no controller de locadoras.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA2AnuDo-MfATFJ8jJqXs94EdYMA-iWadyxYVGL60so9Q8WxBs0ZIvYCrMFrb9FcMCcTOkGtsBZxyTEEExby5q_BAsRHKFTEThx_NcEH-HEKe-9oskA6OJgJ_P1ebvxIKMGgipYd-PfkXe/s1600-h/filtro03.jpg&quot;&gt;&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA2AnuDo-MfATFJ8jJqXs94EdYMA-iWadyxYVGL60so9Q8WxBs0ZIvYCrMFrb9FcMCcTOkGtsBZxyTEEExby5q_BAsRHKFTEThx_NcEH-HEKe-9oskA6OJgJ_P1ebvxIKMGgipYd-PfkXe/s400/filtro03.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5403350709564870482&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 233px; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;Reparem que agora o método índex retorna @locadoras, que ao invés de ter ser resultado do método all (Locadoras.all), é resultado do método search, e de onde vem esse método search? Vem do model locadora, conforme abaixo:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN5YaGNOD4ze-sCdJKhuiggrsLdBPJaYKSUKhPAIX87tQAasld5ycwS1MZzJqVPKoVco4ykDR16NVzHXoStseh1U5rFmtA_zAZxYvbXSNY88PCFaTFp4t_5ORYPxsZQWaYHcxZ1lZLHc0X/s1600-h/filtro04.jpg&quot;&gt;&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN5YaGNOD4ze-sCdJKhuiggrsLdBPJaYKSUKhPAIX87tQAasld5ycwS1MZzJqVPKoVco4ykDR16NVzHXoStseh1U5rFmtA_zAZxYvbXSNY88PCFaTFp4t_5ORYPxsZQWaYHcxZ1lZLHc0X/s400/filtro04.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5403350708218427314&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 173px; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align:justify&quot;&gt;Criamos o método search que recebe um parâmetro, verificamos se p existe, em caso afirmativo, chamamos o método find, onde o mesmo retornará todos os registros que atendam à condição passada, caso contrário, retorna todos os registros.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Este post foi baseado pelo vídeo abaixo:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a href=&quot;http://media.railscasts.com/videos/037_simple_search_form.mov&quot;&gt;http://media.railscasts.com/videos/037_simple_search_form.mov&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/4032291895108541367/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/11/formulario-simples-de-pesquisa.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/4032291895108541367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/4032291895108541367'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/11/formulario-simples-de-pesquisa.html' title='Formulário Simples de Pesquisa'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoX_2tRgbwugsIk_QBKwSs8SN1Gjvw11XaPSpjFWxtfHgqQQDA_Uezb1v85YIxSYs6lHw7z30uI1a53CjtGizUWS4GIoXwyoxrExX4jCkquJEqfDvUxFFpgT3qPbeaBEt1I5z-mILar6dB/s72-c/filtro01.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-8502440931218708115</id><published>2009-10-22T22:51:00.002-03:00</published><updated>2009-10-22T22:55:29.527-03:00</updated><title type='text'>LinguÁgil 2009</title><content type='html'>&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 240px; height: 81px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2czn8MdmNdtyO4ZBRGAGH-4X6VsVTJtFdFQW8G4imGB3l4D8flXAFW43BKeLNu9V6TOD2aZ9-shoI3uCyVAihdAz5Nsr-BUDajaHro_sjyz4HeSz6-HBQf4ntou0QHG76Lbi7AZqNAmu/s400/linguagil.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5395608022669586786&quot; /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;    style=&quot;font-family:Arial, Verdana, sans-serif;font-size:100%;color:#444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; line-height: 20px;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  color: rgb(68, 68, 68); line-height: 20px; font-family:Arial, Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;A proliferação de tecnologias para o desenvolvimento de aplicações web vem gerando exaustivas discussões sobre qual adota-las em seus projetos. Java, PHP e Ruby estão entre as 10 linguagens de programação mais utilizadas no mundo, segundo a &lt;/span&gt;&lt;a href=&quot;http://www.tiobe.com/tiobe_index/index.htm&quot; rel=&quot;nofollow&quot; style=&quot;color: rgb(0, 51, 204); text-decoration: underline; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;TIOBE Programming Community&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;. Em paralelo, os mesmos profissionais buscam melhorar seus serviços adotando metodologias que ao mesmo tempo permitam o controle de seus projetos, gerem valor agregado aos clientes e evitem excesso de burocracia.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(68, 68, 68); line-height: 20px; font-family:Arial, Verdana, sans-serif;font-size:13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Diante desse cenário, os grupos &lt;/span&gt;&lt;a href=&quot;http://br.groups.yahoo.com/group/agile-bahia&quot; rel=&quot;nofollow&quot; style=&quot;color: rgb(0, 51, 204); text-decoration: underline; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;AgileBahia&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;, &lt;/span&gt;&lt;a href=&quot;http://javabahia.blogspot.com/&quot; style=&quot;color: rgb(0, 51, 204); text-decoration: underline; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;JavaBahia&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;, &lt;/span&gt;&lt;a href=&quot;http://groups.google.com.br/group/phpba&quot; style=&quot;color: rgb(0, 51, 204); text-decoration: underline; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;PHPBahia&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; e &lt;/span&gt;&lt;a href=&quot;http://bahiaonrails.blogspot.com/&quot; style=&quot;color: rgb(0, 51, 204); text-decoration: underline; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;RailsBahia&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; realizarão em Salvador a edição 2009 do&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;LinguÁgil - Misturando &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Linguagens e Agilidade&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;. Inédito na Bahia, o evento reune algumas das principais comunidades de TI, buscando estimular aprendizado e discussões em torno de linguagens de programação e metodologias ágeis.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Visitem o site: &lt;/span&gt;&lt;a href=&quot;http://www.linguagil.com.br/&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;http://www.linguagil.com.br/&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/8502440931218708115/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/10/linguagil-2009.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8502440931218708115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8502440931218708115'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/10/linguagil-2009.html' title='LinguÁgil 2009'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2czn8MdmNdtyO4ZBRGAGH-4X6VsVTJtFdFQW8G4imGB3l4D8flXAFW43BKeLNu9V6TOD2aZ9-shoI3uCyVAihdAz5Nsr-BUDajaHro_sjyz4HeSz6-HBQf4ntou0QHG76Lbi7AZqNAmu/s72-c/linguagil.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-7603290192879866836</id><published>2009-10-21T20:26:00.009-03:00</published><updated>2009-10-22T14:40:44.016-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="belongs_to"/><category scheme="http://www.blogger.com/atom/ns#" term="combo"/><category scheme="http://www.blogger.com/atom/ns#" term="filtros"/><category scheme="http://www.blogger.com/atom/ns#" term="has_many"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="relacionamento"/><title type='text'>Formulário com Combo</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana; &quot;&gt;Dando continuidade nas aulas, vou mudar um pouco, ao invés de PowerPoint colocarei um post tradicional. A idéia desse post é mostrar como ajustar uma tela gerada pelo scaffold adicionando uma combobox.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; color: rgb(255, 102, 102); font-family:verdana;&quot;&gt;Obs: O exemplo aqui serve somente para ensinar o uso de combobox, não se trata da regra de negócio que pretendo aplicar, pois na tela de cadastro de memo vocês verão a combo de usuário, mas na realidade, o usuário vai ser pego da sessão.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;Primeiro passo então é gerar o scaffold para memo (visto em aulas passadas).&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;Sabemos que um usuário pode ter zero ou mais memos e um memo só pode ter um usuário, então temos uma relação zero para muitos. Para refletir essa relação, altere os models User e Memo conforme imagem abaixo.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinjVL2hfWnj9VsIs5VoHjl_QaZFtSuvj4dWRKn8klP2d_Jub3heuAzX9TPj-2D12-VidPgWUHiTUPRh2aH3fBXaMFvk-qhWZM4ASRI7H8OoHkMDceDotKY6of58sqvXYAZSNo2tIRY6bK1/s1600-h/img01.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinjVL2hfWnj9VsIs5VoHjl_QaZFtSuvj4dWRKn8klP2d_Jub3heuAzX9TPj-2D12-VidPgWUHiTUPRh2aH3fBXaMFvk-qhWZM4ASRI7H8OoHkMDceDotKY6of58sqvXYAZSNo2tIRY6bK1/s400/img01.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5395202429298397090&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 243px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Como memo se relaciona com usuário, sua tela de cadastro (&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt;view new&lt;/span&gt;) deve ter uma combo com os usuários disponíveis para seleção.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:Georgia, serif;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9tQ1Izv6gvEvyHOPRyU9nrwhR4S0NvsDwOP_Nwt0cSqodjtve3-Lf7Zj8P0X7FjlSfBqisfYewNITgzKGL2ZKDVHG9Jte9smJd_d0D5tl68OBvRZkMTeBgUGkVMe_IgxcEzEJch2uLRUB/s1600-h/img02.jpg&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9tQ1Izv6gvEvyHOPRyU9nrwhR4S0NvsDwOP_Nwt0cSqodjtve3-Lf7Zj8P0X7FjlSfBqisfYewNITgzKGL2ZKDVHG9Jte9smJd_d0D5tl68OBvRZkMTeBgUGkVMe_IgxcEzEJch2uLRUB/s400/img02.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5395203146549794994&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 268px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Agora abra o código fonte da view new do controller memo, no meu caso (c:\agenda\app\views\memos\new.html.erb). Veja que onde tem &lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt;&lt;/span&gt; trocamos por &lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt;&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8YPah_r5h3RVccSubBu7LQ18nxf4HwUfNKyHj-VqCqpSMU9F6sGrtgjOdhddyLJ3oxTfQAsUdlcDV12JaL9ZEg7JAbyh59fw-C2UTmmbBLoPVhXTj9JcLogWiVeXaL-BFjXLYB8Y2Dg7f/s400/img03.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5395205274285229090&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 198px; &quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Georgia, serif;color:#0000EE;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;O método helper&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt; &lt;/span&gt;f.select é o responsável em criar uma caixa de seleção e recebe os parâmetros:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;:user_id – é o nome do campo na tabela memo&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;@users – hash que é retornado pelo controller *veremos abaixo&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;:prompt=&gt;”texto” – texto que aparece na combo&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Agora abra o memos_controller.rb e adicione um filtro que chama o método loadUsers antes dos métodos new, edit, create e update. Altere também o método index colocando o include no Memo.all, isso fará que o método carregue somente uma vez os usuários.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Georgia, serif;color:#0000EE;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Georgia, serif;color:#0000EE;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); &quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ9zgABb0tboHrzbAWxPHBnmCCi1wdn6DXvrmACMgHSITHpJHg59_w2jhY74csQMga8iNePHUjdhfLsjCxLsbBMHQ1SNtGZsib7w45YN-1HzYJwG2vh7W7tph0vAtJaEMLVNi8crG-YTAx/s1600-h/img04.jpg&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ9zgABb0tboHrzbAWxPHBnmCCi1wdn6DXvrmACMgHSITHpJHg59_w2jhY74csQMga8iNePHUjdhfLsjCxLsbBMHQ1SNtGZsib7w45YN-1HzYJwG2vh7W7tph0vAtJaEMLVNi8crG-YTAx/s400/img04.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5395480321907216546&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 169px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Georgia, serif;color:#0000EE;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Adicione antes do último end o código do método loadUsers que retorna o objeto @users (lembra-se que usamos ele na view new para preencher a combo) que é uma hash de usuários. Cada objeto só tem os atributos login e id.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt;O método collect retorna um hash de todos os objetos retornados no método all.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4QSbbelOARLZfetd8YPAJh0D973kp8L6dk9OuDss18JzbL4OG8B6nfALR4KtPoj0R0a-ouJXm-0nxtd3lWzqBRO5oDCHsESAFUZWrW-LgFmt5W-Z4r-NSPghUJCZnadZphct_q7X2P1Ll/s400/img05.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5395207082600469058&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 92px; &quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Ao submeter a página, sabemos que o sistema redirecionará para a view show (c:\agenda\app\views\memos\show.html.erb) , e nela devemos mostrar o nome do usuário, então basta ajustar o código conforme imagem abaixo. Repare que só alteramos a linha 7, onde tinha &lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt;@memo.user&lt;/span&gt; colocamos &lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF6666;&quot;&gt;@memo.user.login&lt;/span&gt;.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5YJ6Yw6twe0WODcquzNx27kn4dFaBvKQngmQxEmI8bvAqHgqhGA82Xq9I0mBWsyVLk6lyd7CyW6-2DkaZzVRnMMD_X_7Kkk4wXS8pQk_untvj_LN7vOxPIn4ICmpQXTeKklWYtJR0lQ54/s400/img06.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5395208581091801330&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 193px; &quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Georgia, serif;color:#0000EE;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color: rgb(0, 0, 0);  font-family:verdana;&quot;&gt;&lt;div style=&quot;text-align: justify; &quot;&gt;Analogamente, você pode alterar a view index para que mostre também o nome do usuário na listagem que aparece.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/7603290192879866836/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/10/formulario-com-combo.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/7603290192879866836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/7603290192879866836'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/10/formulario-com-combo.html' title='Formulário com Combo'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinjVL2hfWnj9VsIs5VoHjl_QaZFtSuvj4dWRKn8klP2d_Jub3heuAzX9TPj-2D12-VidPgWUHiTUPRh2aH3fBXaMFvk-qhWZM4ASRI7H8OoHkMDceDotKY6of58sqvXYAZSNo2tIRY6bK1/s72-c/img01.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-1198388469735186070</id><published>2009-09-30T15:18:00.001-03:00</published><updated>2009-09-30T15:20:14.491-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="autenticação"/><category scheme="http://www.blogger.com/atom/ns#" term="authlogic"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><title type='text'>Autenticação no Rails</title><content type='html'>&lt;iframe src=&quot;http://docs.google.com/present/embed?id=dgd4jfgj_497fv89wkdt&quot; frameborder=&quot;0&quot; width=&quot;410&quot; height=&quot;342&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Para baixar os fontes clique &lt;a href=&quot;http://www.4shared.com/file/136573015/b7e8a109/sistema.html&quot; target=_blank&gt;aqui.&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/1198388469735186070/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/autenticacao-no-rails.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1198388469735186070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1198388469735186070'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/autenticacao-no-rails.html' title='Autenticação no Rails'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-6488382068477196209</id><published>2009-09-13T00:21:00.003-03:00</published><updated>2009-09-13T00:25:19.061-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cabeça"/><category scheme="http://www.blogger.com/atom/ns#" term="livro"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="use"/><title type='text'>Livro: Use a Cabeça! Rails</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;A AltaBooks disponibiliza o primeiro capítulo do livro Use a Cabeça! Rails, acesso link &lt;a href=&quot;http://altabooks.tempsite.ws/capitulos_amostra/UC%20rails.pdf&quot;&gt;http://altabooks.tempsite.ws/capitulos_amostra/UC%20rails.pdf&lt;/a&gt; e divirta-se!&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3_94c3t1wmBhO1OlB_Jwm8EiaUFeg2E0SEJ6uu918Ra8ptfdBmxjzJtMcYhs7Ewm7N5jjgetkSgg1v7joL9YETw6xS-8srSdJLz82k4OgHqCm6cBndIzIcwLyDA_fjQ7Q6bR4zd3MY-PW/s1600-h/useacabecarails.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 122px; height: 165px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3_94c3t1wmBhO1OlB_Jwm8EiaUFeg2E0SEJ6uu918Ra8ptfdBmxjzJtMcYhs7Ewm7N5jjgetkSgg1v7joL9YETw6xS-8srSdJLz82k4OgHqCm6cBndIzIcwLyDA_fjQ7Q6bR4zd3MY-PW/s400/useacabecarails.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5380787742645486594&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/6488382068477196209/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/livro-use-cabeca-rails.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/6488382068477196209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/6488382068477196209'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/livro-use-cabeca-rails.html' title='Livro: Use a Cabeça! Rails'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3_94c3t1wmBhO1OlB_Jwm8EiaUFeg2E0SEJ6uu918Ra8ptfdBmxjzJtMcYhs7Ewm7N5jjgetkSgg1v7joL9YETw6xS-8srSdJLz82k4OgHqCm6cBndIzIcwLyDA_fjQ7Q6bR4zd3MY-PW/s72-c/useacabecarails.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-7854145997098620185</id><published>2009-09-11T00:01:00.002-03:00</published><updated>2009-09-12T22:41:56.813-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="RoR"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>Introdução ao Rails</title><content type='html'>&lt;iframe src=&quot;http://docs.google.com/present/embed?id=dgd4jfgj_430fcgbdndg&quot; frameborder=&quot;0&quot; width=&quot;410&quot; height=&quot;342&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/7854145997098620185/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/introducao-ao-rails.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/7854145997098620185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/7854145997098620185'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/introducao-ao-rails.html' title='Introdução ao Rails'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-1623855308014790260</id><published>2009-09-06T20:43:00.002-03:00</published><updated>2009-09-06T20:46:17.006-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>Introdução ao Ruby</title><content type='html'>&lt;iframe src=&quot;http://docs.google.com/present/embed?id=dgd4jfgj_357d4srdz7h&quot; frameborder=&quot;0&quot; width=&quot;410&quot; height=&quot;342&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Slides da aula de Introdução ao Ruby da disciplina Desenvolvimento Web com Banco de Dados da Faculdade Hélio Rocha.</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/1623855308014790260/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/introducao-ao-ruby.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1623855308014790260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/1623855308014790260'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/09/introducao-ao-ruby.html' title='Introdução ao Ruby'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-643020899190421420</id><published>2009-07-24T10:08:00.003-03:00</published><updated>2009-07-24T10:11:51.730-03:00</updated><title type='text'>Cursó Ágil na Prática</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.indexti.com/preinscricao.php&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 394px; height: 104px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKKgYuTGZPolRn5tFoCDzhs-gt8AwOw1lsiABtOOk5II0A8F_Zpo7nUoZpLK0jsqwxqP5Nw49NnVv_Dqve9rXLYwk8F1VsysLxfRBlL-okF28CIRMvUKWKz5dyz_IDKFwMJNZ_v2FVC1f9/s400/banner.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5362012902605312930&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;A Index TI, empresa especializada em metodologias ágeis, oferece o curso “Ágil na Prática”, composto por aulas presenciais teóricas e práticas, demonstrando a aplicabilidade das metodologias de gerenciamento e desenvolvimento ágil Scrum e XP (Extreme Programming) utilizando o framework Ruby on Rails.&lt;br /&gt;&lt;br /&gt;Maiores informações clique &lt;a href=&quot;http://www.indexti.com/preinscricao.php&quot;&gt;aqui&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/643020899190421420/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/07/curso-agil-na-pratica.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/643020899190421420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/643020899190421420'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/07/curso-agil-na-pratica.html' title='Cursó Ágil na Prática'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKKgYuTGZPolRn5tFoCDzhs-gt8AwOw1lsiABtOOk5II0A8F_Zpo7nUoZpLK0jsqwxqP5Nw49NnVv_Dqve9rXLYwk8F1VsysLxfRBlL-okF28CIRMvUKWKz5dyz_IDKFwMJNZ_v2FVC1f9/s72-c/banner.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-6563631589057988258</id><published>2009-04-12T00:10:00.000-03:00</published><updated>2009-04-12T00:11:27.603-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="controller"/><category scheme="http://www.blogger.com/atom/ns#" term="crud"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="view"/><title type='text'>Curso de Ruby on Rails - parte 5</title><content type='html'>&lt;iframe src=&#39;http://docs.google.com/EmbedSlideshow?docid=dgd4jfgj_2642rz86pgq&#39; frameborder=&#39;0&#39; width=&#39;410&#39; height=&#39;342&#39;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/6563631589057988258/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/04/curso-de-ruby-on-rails-parte-5.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/6563631589057988258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/6563631589057988258'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/04/curso-de-ruby-on-rails-parte-5.html' title='Curso de Ruby on Rails - parte 5'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-8084636384219367755</id><published>2009-03-20T21:32:00.001-03:00</published><updated>2009-03-20T21:34:38.046-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="agilidade"/><category scheme="http://www.blogger.com/atom/ns#" term="maré"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>Maré de Agilidade</title><content type='html'>Entre os dias 26.03 e 31.03 ocorrerá em Salvador a 2ª Edição do Evento Maré de Agilidade. &lt;br /&gt;&lt;br /&gt;http://www.maredeagilidade.com.br/</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/8084636384219367755/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/03/mare-de-agilidade.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8084636384219367755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8084636384219367755'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/03/mare-de-agilidade.html' title='Maré de Agilidade'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-8988867316306985007</id><published>2009-03-10T16:44:00.000-03:00</published><updated>2009-03-10T16:45:10.072-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="controller"/><category scheme="http://www.blogger.com/atom/ns#" term="model"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="RoR"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>Curso de Ruby on Rails - parte 4</title><content type='html'>&lt;iframe src=&#39;http://docs.google.com/EmbedSlideshow?docid=dgd4jfgj_227cj592bfb&#39; frameborder=&#39;0&#39; width=&#39;410&#39; height=&#39;342&#39;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/8988867316306985007/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/03/curso-de-ruby-on-rails-parte-4.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8988867316306985007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8988867316306985007'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/03/curso-de-ruby-on-rails-parte-4.html' title='Curso de Ruby on Rails - parte 4'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-8692052164597519838</id><published>2009-02-23T01:17:00.000-03:00</published><updated>2009-02-23T01:18:03.327-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="generator"/><category scheme="http://www.blogger.com/atom/ns#" term="model"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="RoR"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>Curso de Ruby on Rails - parte 3</title><content type='html'>&lt;iframe src=&#39;http://docs.google.com/EmbedSlideshow?docid=dgd4jfgj_200d55dmm6x&#39; frameborder=&#39;0&#39; width=&#39;410&#39; height=&#39;342&#39;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/8692052164597519838/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/curso-de-ruby-on-rails-parte-3.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8692052164597519838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/8692052164597519838'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/curso-de-ruby-on-rails-parte-3.html' title='Curso de Ruby on Rails - parte 3'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-934251135342749728</id><published>2009-02-15T17:54:00.000-03:00</published><updated>2009-02-15T17:57:58.189-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="RoR"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>Curso de Ruby on Rails - parte 2</title><content type='html'>&lt;iframe src=&#39;http://docs.google.com/EmbedSlideshow?docid=dgd4jfgj_179gzpwbv6n&#39; frameborder=&#39;0&#39; width=&#39;410&#39; height=&#39;342&#39;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/934251135342749728/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/curso-de-ruby-on-rails-parte-2.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/934251135342749728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/934251135342749728'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/curso-de-ruby-on-rails-parte-2.html' title='Curso de Ruby on Rails - parte 2'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-3203040511460305208</id><published>2009-02-15T17:53:00.000-03:00</published><updated>2009-02-15T17:56:33.434-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="RoR"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>Curso de Ruby on Rails - parte 1</title><content type='html'>&lt;iframe src=&#39;http://docs.google.com/EmbedSlideshow?docid=dgd4jfgj_137dps3s6g6&#39; frameborder=&#39;0&#39; width=&#39;410&#39; height=&#39;342&#39;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/3203040511460305208/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/curso-de-ruby-on-rails-parte-1.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/3203040511460305208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/3203040511460305208'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/curso-de-ruby-on-rails-parte-1.html' title='Curso de Ruby on Rails - parte 1'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5165138530817586147.post-6827160201511927317</id><published>2009-02-15T17:45:00.000-03:00</published><updated>2009-02-15T17:54:52.257-03:00</updated><title type='text'>Boas vindas!</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Caros leitores,&lt;br /&gt;&lt;br /&gt;Eu tenho um costume de fazer slides de tudo que eu esteja estudando. Como decidi estudar o Ruby On Rails esse ano, venho através desse blog disponibilizar esses slides.&lt;br /&gt;&lt;br /&gt;Caso eu tenha feito alguma referência a algum material e não tenha colocado, favor me enviem um e-mail para que possa fazer as devidas correções.&lt;br /&gt;&lt;br /&gt;Todo os slides que colocarei aqui podem ser distribuídos e modificados conforme necessidade de cada um, só peço que assim como eu cito as referências citem meu nome ou pelo menos o meu blog.&lt;br /&gt;&lt;br /&gt;Sejam bem vindos e qualquer ajuda, dica, indicação serão bem vindos.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahiaonrails.blogspot.com/feeds/6827160201511927317/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/boas-vindas.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/6827160201511927317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5165138530817586147/posts/default/6827160201511927317'/><link rel='alternate' type='text/html' href='http://bahiaonrails.blogspot.com/2009/02/boas-vindas.html' title='Boas vindas!'/><author><name>Luciano Borges</name><uri>http://www.blogger.com/profile/14731628279494264615</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>