âàãîí-ðåñòîðàí ÁÎÐÈÑ ÂÎËÜÔÑÎÍ Ñïåöâûïóñê: Õàêåð, íîìåð #073, ñòð. 073-060-4 end def edit @disk = Disk.find(@params["id"]) @genres = Genre.find_all end end Çàéìåìñÿ ñàìèì øàáëîíîì, êîòîðûé áóäåò ïîñòðîåí ïî òåì æå ïðàâèëàì, ÷òî è ïðåäûäóùèé: Øàáëîí äëÿ ðåäàêòèðîâàíèÿ äèñêà <html> <head> <title>Ðåäàêòèðîâàíèå äèñêà</title> </head> <body> <h1>Ðåäàêòèðîâàíèå äèñêà</h1> <form action="../update/<%= @disk.id %>" method="POST""> <input id="disk_id" name="disk[id]" size="30" type="hidden" value="<%= @disk.id %>" /> <p><b>Íàçâàíèå</b><br> <input id="disk_title" name="disk[title]" size="30" type="text" value="<%= @disk.title %>" /> </p> <p><b>Èñïîëíèòåëü</b><br> <input id="disk_artist" name="disk[artist]" size="30" type="text" value="<%= @disk.artist %>" /> </p> <p><b>Îïèñàíèå</b><br> <textarea id="disk_description" name="disk[description]"><%= @disk.description %></textarea> </p> <p><b>Æàíð:</b><br> <select name="disk[genre_id]"> <% @genres.each do |genre| %> <option value="<%= genre.id %>" <%= ' selected' if genre.id == @disk.genre_id %>> <%= genre.title %> </option> <% end %> </select></p> <input type="submit" value="Update" /> </form> <a href="/disk/show/<%= @disk.id %>"> Show </a> | <a href="/disk/list">Back</a> </body> Âñå, îñíîâíàÿ ÷àñòü ðàáîòû çàâåðøåíà, ïåðåéäåì ê âîëüíîé ïðîãðàììå. ß áû íà÷àë ñ íîðìàëèçàöèè íàøåé ìàëåíüêîé áàçû äàííûõ. [íà çàêóñêó.] ×òî ñòîèò îòìåòèòü? Ó ìåíÿ íà èñïîëíåíèå îïèñàííîãî âûøå ïðèëîæåíèÿ óøëî îêîëî 30 ìèíóò. Ýòî ïðè òîì, ÷òî ÿ ïîñòîÿííî äåëàë ñêðèíû è êîíñïåêòèðîâàë äåéñòâèÿ è ðåçóëüòàòû. Åùå îäèí ïëþñ - ìû íå ðàáîòàëè ñ SQL íàïðÿìóþ: ÿ ïðèâîäèë êîä òîëüêî äëÿ òîãî, ÷òîáû òû óâèäåë ñòðóêòóðó äàííûõ. Êîäà ìû ïèñàëè ñîâñåì ìàëî, áîëüøàÿ ÷àñòü – ýòî øàáëîíû, êîòîðûå äåëàþòñÿ îäèí ðàç! Î ïðîäâèíóòûõ âîçìîæíîñòÿõ Ruby on Rails ÿ ïîñòàðàþñü ðàññêàçàòü â ñëåäóþùèõ ñòàòüÿõ, âêëþ÷àÿ ìîäíûå íûí÷å Ajax-òåõíîëîãèè. ÏÅÐÅÂÎÄ ÏÈÑÜÌÀ ÌÀÖÀ  ÑÏÈÑÎÊ ÐÀÑÑÛËÊÈ RUBY-TALK. ÏÈÑÜÌÎ ÄÀÒÈÐÎÂÀÍÎ 4 ÈÞÍß 1999 ÃÎÄÀ RUBY ÐÎÄÈËÑß 23 ÔÅÂÐÀËß 1993 ÃÎÄÀ.  ÒÎÒ ÄÅÍÜ ß ÁÅÑÅÄÎÂÀË ÑÎ ÑÂÎÈÌ ÊÎËËÅÃÎÉ Î ÂÎÇÌÎÆÍÎÑÒÈ ÑÓÙÅÑÒÂÎÂÀÍÈß ÎÁÚÅÊÒÍÎ-ÎÐÈÅÍÒÈÐÎÂÀÍÍÎÃÎ ÑÊÐÈÏÒÎÂÎÃÎ ßÇÛÊÀ. ß ÇÍÀË PERL (PERL4, À ÍÅ PERL5), ÍÎ ÎÍ ÌÍÅ ÍÅ ÍÐÀÂÈËÑß - ÁÛË Â ÍÅÌ ÍÅÊÈÉ ÏÐÈÂÊÓÑ ÈÃÐÓØÅ×ÍÎÃÎ ßÇÛÊÀ (ÎÍ ÅÑÒÜ È ÄÎ ÑÈÕ ÏÎÐ). À ÎÁÚÅÊÒÍÎ-ÎÐÈÅÍÒÈÐÎÂÀÍÍÛÉ ÈÍÒÅÐÏÐÅÒÈÐÓÅÌÛÉ ßÇÛÊ ÊÀÇÀËÑß ÌÍÎÃÎÎÁÅÙÀÞÙÈÌ.  ÒÎ ÂÐÅÌß ß ÇÍÀË PYTHON. ÍÎ ÎÍ ÒÎÆÅ ÌÅÍß ÍÅ ÓÑÒÐÀÈÂÀË, ÒÀÊ ÊÀÊ ß ÍÅ Ñ×ÈÒÀË ÅÃÎ ÍÀÑÒÎßÙÈÌ ÎÁÚÅÊÒÍÎ-ÎÐÈÅÍÒÈÐÎÂÀÍÍÛÌ ßÇÛÊÎÌ. ÅÃÎ OO-ÑÂÎÉÑÒÂÀ ÊÀÇÀËÈÑÜ ÍÀÄÑÒÐÎÉÊÎÉ ÍÀÄ ßÇÛÊÎÌ. ÌÍÅ, ÊÀÊ ßÇÛÊÎÂÎÌÓ ÌÀÍÜßÊÓ È ÔÀÍÀÒÓ ÎÁÚÅÊÒÍÎ-ÎÐÈÅÍÒÈÐÎÂÀÍÍÎÃÎ ÏÐÎÃÐÀÌÌÈÐÎÂÀÍÈß Ñ ÏßÒÍÀÄÖÀÒÈËÅÒÍÈÌ ÑÒÀÆÅÌ, Î×ÅÍÜ-Î×ÅÍÜ ÕÎÒÅËÎÑÜ, ×ÒÎÁÛ ÑÓÙÅÑÒÂÎÂÀË ÈÑÒÈÍÍÎ ÎÁÚÅÊÒÍÎ-ÎÐÈÅÍÒÈÐÎÂÀÍÍÛÉ, ÏÐÎÑÒÎÉ Â ÈÑÏÎËÜÇÎÂÀÍÈÈ ßÇÛÊ. ß ÏÛÒÀËÑß ÍÀÉÒÈ ÒÀÊÎÉ ßÇÛÊ, ÍÎ ÅÃÎ ÍÅ ÁÛËÎ. ÒÎÃÄÀ ß ÐÅØÈË ÅÃÎ ÑÎÇÄÀÒÜ. ÏÐÎØËÎ ÍÅÑÊÎËÜÊÎ ÌÅÑßÖÅÂ, ÏÐÅÆÄÅ ×ÅÌ ÈÍÒÅÐÏÐÅÒÀÒÎÐ ÇÀÐÀÁÎÒÀË. ß ÄÎÁÀÂÈË Â ÌÎÉ ßÇÛÊ ÒÎ, ×ÒÎ ÌÍÅ ÕÎÒÅËÎÑÜ - ÈÒÅÐÀÒÎÐÛ, ÎÁÐÀÁÎÒÊÓ ÈÑÊËÞ×ÅÍÈÉ, ÀÂÒÎÌÀÒÈ×ÅÑÊÓÞ ÑÁÎÐÊÓ ÌÓÑÎÐÀ. ÇÀÒÅÌ ß ÐÅÎÐÃÀÍÈÇÎÂÀË ÑÂÎÉÑÒÂÀ PERL'À È ÐÅÀËÈÇÎÂÀË ÈÕ ÊÀÊ ÁÈÁËÈÎÒÅÊÓ ÊËÀÑÑÎÂ.  ÄÅÊÀÁÐÅ 1995 ÃÎÄÀ ß ÎÏÓÁËÈÊÎÂÀË RUBY 0.95  ßÏÎÍÑÊÈÕ ÍÎÂÎÑÒÍÛÕ ÃÐÓÏÏÀÕ. Ñ ÒÅÕ ÏÎÐ ÏÎßÂÈËÈÑÜ ÑÀÉÒÛ, ÑÏÈÑÊÈ ÐÀÑÑÛËÎÊ.  ÑÏÈÑÊÀÕ ÐÀÑÑÛËÎÊ ÏÐÎÈÑÕÎÄßÒ ÆÀÐÊÈÅ ÄÈÑÊÓÑÑÈÈ. ÑÀÌÛÉ ÑÒÀÐÛÉ, RUBY-LIST, ÑÅÉ×ÀÑ ÑÎÄÅÐÆÈÒ 14789 ÏÈÑÅÌ. |