<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>rubyrails &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/rubyrails/</link>
	<description>Feed of posts on WordPress.com tagged "rubyrails"</description>
	<pubDate>Wed, 20 Aug 2008 21:01:24 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[[Erro]undefined method `require_gem' for main:Object]]></title>
<link>http://soporprazer.wordpress.com/?p=70</link>
<pubDate>Wed, 09 Jul 2008 17:07:49 +0000</pubDate>
<dc:creator>Édipo Luis Féderle</dc:creator>
<guid>http://soporprazer.wordpress.com/?p=70</guid>
<description><![CDATA[Uma pequena dica aqui, caso isso aconteça com você também, bom fui executar uma tarefa rake aqui ]]></description>
<content:encoded><![CDATA[<p>Uma pequena dica aqui, caso isso aconteça com você também, bom fui executar uma tarefa rake aqui e retornou o seguinte erro:</p>
<p><strong>undefined method `require_gem' for main:Object</strong></p>
<p>me parece que é algo com a versão nova do RubyGens, eu to rodando a versão 1.1.1 e o rails 1.1.2, se por acaso voçê também tenha que usar essa versão e encontrar esse tipo de erro, ele pode ser corrigido fazendo uma pequena mudança no arquivo boot.rb que está dentro do diretório config do seu projeto, então faça o seguinte:</p>
<p>em projetc_name/config/boot.rb procure pela linha:</p>
<p><strong>require_gem "rails", "=#{version}" </strong></p>
<p>e mude para</p>
<p><strong> gem "rails", "=#{version}"</strong></p>
<p>Pronto, somente isso.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Rails Upgrade Bumps]]></title>
<link>http://jameshalberg.wordpress.com/?p=127</link>
<pubDate>Tue, 08 Jul 2008 02:18:44 +0000</pubDate>
<dc:creator>Jim</dc:creator>
<guid>http://jameshalberg.wordpress.com/?p=127</guid>
<description><![CDATA[After skimming the &#8220;What&#8217;s New&#8221; posts for several Rails versions without finding a]]></description>
<content:encoded><![CDATA[<p>After skimming the "What's New" posts for several Rails versions without finding anything worth jumping at, it was time to upgrade.  While JSON enhancements (fixes) are the driving reason for the move, there certainly are a few "nice to haves" that I've been looking forward to checking out.</p>
<p> </p>
<p><strong>Partial Updates</strong></p>
<p>Unfortunately, one of the things I've been looking forward to completely falls flat in my book... Partial Updates (to some extent: Dirty Objects).  </p>
<p>When I first read the paragraph-blurb about this addition I was pretty impressed and was looking forward to seeing how it was implemented.  I was much less impressed when I got my head under the hood.  Relying totally on use of ActiveRecord setter methods is a pretty big fail in my book.  Tracking down every place that a field is edited "in place" to specially flag it (xyz_will_change) is completely unreasonable and maintaining that rule going forward is an annoyance that I just don't need.</p>
<p>I played with several ways of attempting to set flags when changes were "likely" (ex: when getters were used) or always flagging "likely to be edited in place" attributes (ex: serialized fields) but just was ending up with lots of additional complexity, reduced reliability, and basically voiding out any gained efficiency.</p>
<p>Having this enabled by default (apparently the plan) is just plain confusing:  Seems much more reasonable to enabled this when you know it's going to benefit you.  I also don't like that it adds another question for a new developer to ask (or get tripped up on) when joining a project.  I really don't want to have to read every line of the new guys code for the first three months to make sure that he's sticking to the rules (and setting up tests to verify it explicitly).</p>
<p> </p>
<p><strong>XML handling</strong></p>
<p>Null values are now flagged as such instead of just being blank, like they would look if they were... uh... blank.  This is a good thing - it also tripped me up for a bit.</p>
<p> </p>
<p><strong>Eager Loading</strong></p>
<p>It seems eager loading has been changed a bit.  Statements that used to result in :include items being joined right into a single large query now (may) result in several smaller statements.  </p>
<p>Does it make queries more efficient?  Probably.</p>
<p>Does it increase db traffic?  Probably.</p>
<p>Is it a bad thing?  Probably Not (overall).</p>
<p>Is it a bad thing that stuff that worked before doesn't?  Yeah, that's annoying.</p>
<p>My specific problem is on an association defined with a :select =&#62; "distinct labels.*".  I played around a bit with potential changes down in the AR guts but in the end (unfortunately) I ended up basically tricking it into running it as a single statement.  It's not at all difficult to make it happen but it's also not at all straightforward - and I hate it when the framework makes me write a big comment.</p>
<p>For me, I added an :order to my find that would make it order by something in a different table, which scares the thing into running a single statement.  Ideally, I'd like to have something explicit (maybe on the association but more likely on the find itself) that would allow an optional param to say "run this as one statement".  That would let someone reading the code clearly see what's going on - instead of wondering (or more likely: not noticing) that I'm ordering by some pointless field.</p>
<p> </p>
<p><strong>Overall</strong></p>
<p style="text-align:left;">Not nearly as bad as I had expected.  Felt good to get some deprecated stuff fixed and get some of my old TODOs out of there in the process.  Also good to have it (almost) over with and to, at least temporarily,<a href="http://bja.oxfordjournals.org/cgi/content/full/90/5/708">have caught up with the Joneses</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[no such file to load — sqlite3/database]]></title>
<link>http://wuhai.wordpress.com/?p=54</link>
<pubDate>Sun, 06 Jul 2008 01:00:41 +0000</pubDate>
<dc:creator>wuhai</dc:creator>
<guid>http://wuhai.wordpress.com/?p=54</guid>
<description><![CDATA[This is RHEL5, Rails 2.1.0. I got this error message &#8220;no such file to load — sqlite3/databas]]></description>
<content:encoded><![CDATA[<p>This is RHEL5, Rails 2.1.0. I got this error message "no such file to load — sqlite3/database" after following the first example from book "Agile-Web-Development-Rails-2nd". After searching around, finally found the answer at http://andrew.chalkley.org/post/39984897/fix-sqlite3-error-on-ruby-enterprise-edition:</p>
<p>cd /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2/lib/sqlite3<br />
sudo chmod +r *</p>
<p>Today I got this error when using 'rake db:migrate':</p>
<pre>sqlite3_api.so: <span class="highlight">undefined</span> <span class="highlight">symbol</span>: <span class="highlight">RSTRING_PTR</span>

The answer is at http://d.hatena.ne.jp/GARAPON/20080602/1212387419, the ruby version in RHEL5 is 1.8.5, so workaround is:

Put the following lines in file '/usr/lib/ruby/1.8/i386-linux/ruby.h':
#define <span class="highlight">RSTRING_PTR</span>(s) (RSTRING(s)-&#62;ptr)
#define RSTRING_LEN(s) (RSTRING(s)-&#62;len)

gem uninstall sqlite3-ruby
gem install sqlite3-ruby
rake db:migrate

Then do the above 'sudo chmod +r *' AGAIN to get rid of the 'no such file to load' error message.

[root@wpprdwf ~]# gem install mysql -- --with-mysql-lib=/usr/lib/mysql
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed</pre>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Problema com RubyGems]]></title>
<link>http://soporprazer.wordpress.com/2008/06/15/problema-com-rubygems/</link>
<pubDate>Sun, 15 Jun 2008 01:01:06 +0000</pubDate>
<dc:creator>Édipo Luis Féderle</dc:creator>
<guid>http://soporprazer.wordpress.com/2008/06/15/problema-com-rubygems/</guid>
<description><![CDATA[Pode ser que quando você instalar no Ubuntu ou derivados o RubyGems via source ira retornar o segui]]></description>
<content:encoded><![CDATA[<p>Pode ser que quando você instalar no Ubuntu ou derivados o RubyGems via source ira retornar o seguinte erro:<br />
<strong><br />
/usr/bin/gem:23: uninitialized constant Gem::GemRunner(NameError)</strong></p>
<p>Para resolver esse pequeno problema você simplesmente tem que adicionar um <strong>require </strong>no seguinte arquivo: /usr/bin/gem</p>
<p>Então faça:</p>
<p><strong> sudo gedit /usr/bin/gem</strong></p>
<p>e logo abaixo de :</p>
<p><em><span style="font-family:sans-serif;">require 'rubygems'</span></em></p>
<p>add isso:<br />
<big><big><br />
</big><em><code>require 'rubygems/gem_runner'</code></em></big></p>
<p><code><big><br />
Feche o arquivo e pronto podera usar o RubyGem sem nenhum problema.</big></code><big><em><code><br />
</code></em></big></p>
<p><strong></strong></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[A brief update to everyone re: April 8th TSOT Ruby on Rails Project Night]]></title>
<link>http://correlations.wordpress.com/?p=67</link>
<pubDate>Mon, 07 Apr 2008 19:58:44 +0000</pubDate>
<dc:creator>correlations</dc:creator>
<guid>http://correlations.wordpress.com/?p=67</guid>
<description><![CDATA[A brief update to everyone registered for tomorrow’s TSOT Ruby on Rails Project Night:


We are lo]]></description>
<content:encoded><![CDATA[<p class="MsoNormal">A brief update to everyone registered for tomorrow’s TSOT Ruby on Rails Project Night:</p>
<p class="MsoNormal">
<div style="border:medium medium 1.5pt none none solid 0 0 windowtext;padding:0 0 1pt;">
<p class="MsoNormal" style="border:medium none;padding:0;">We are looking forward to a great evening, however there has been a slight change in our schedule for tomorrow night:</p>
<p class="MsoNormal" style="border:medium none;padding:0;">
</div>
<p class="MsoNormal"><strong>Mike Bowler</strong> (<a href="http://www.gargoylesoftware.com/">GargoyleSoftware.com</a>) returns armed with a fist full of meta-programming as he looks at “<strong>Diving into meta-programming with Date.once</strong>”</p>
<p class="MsoNormal">
<p class="MsoNormal"><strong>Kristan ‘Krispy’ Uccello</strong> will examine the architecture and design of the <a href="http://www.domainer.com/">Domainer.com</a> platform as he investigates, “<strong>Web Development Demons: Why it can be hard to do something simple</strong>”.</p>
<p class="MsoNormal">
<div style="border:medium medium 1.5pt none none solid 0 0 windowtext;padding:0 0 1pt;">
<p class="MsoNormal" style="border:medium none;padding:0;">And as part of our updated schedule…</p>
<p class="MsoNormal" style="border:medium none;padding:0;"><strong>Luke Galea</strong> from Medical Decision Logic, Inc. <a href="http://www.mdlogix.com/">(mdlogix.com</a>). Luke has agreed to revisit the migration number issue from his last presentation; but will also be presenting on <strong>ActiveResource</strong>,<strong> and his project to replace active_record with active_resource</strong> in the consolidation of Hospital research.</p>
</div>
<p class="MsoNormal">
<p class="MsoNormal">We regret that <strong>Leila Boujnane</strong>, co-founder and CEO of <strong>Idée Inc</strong>. (<a href="http://www.ideeinc.com/">idéeinc.com</a>), was called out of town. However, Leila will join us at our next event, May 13<sup>th</sup>, to discuss and demonstrate her company’s highly successful <strong>image search APIs</strong>.</p>
<p class="MsoNormal">We thank you all for your ongoing support and interest – as always, if you would like to get involved as a presenter please email <a href="mailto:corina.newby@tsotinc.com">corina.newby@tsotinc.com</a> or call (416) 908-6082.</p>
<p class="MsoNormal">See you tomorrow night!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Ruby finally sends me over the edge, or The beauty of ruby]]></title>
<link>http://attrwriter.wordpress.com/?p=4</link>
<pubDate>Sat, 15 Mar 2008 11:05:46 +0000</pubDate>
<dc:creator>Simon</dc:creator>
<guid>http://attrwriter.wordpress.com/?p=4</guid>
<description><![CDATA[I don&#8217;t know how many times I have found myself writing things like this:


if %w{new create e]]></description>
<content:encoded><![CDATA[<p>I don't know how many times I have found myself writing things like this:<br />
[sourcecode language='ruby']<br />
if %w{new create edit update}.include? action_name<br />
  ...<br />
end[/sourcecode]<br />
And each time it grates with me. It's not that it's wrong, but it's not what my mind is thinking. Whilst it adds up to the same thing, I'm not wanting to test the array literal, but the value of action_name. It's like, testing for 1 == a. Again, not wrong, but well, um, wrong! And such a situation seems to go against the very ethos of ruby. Hey, if I wanted to write code that seemed to go against my gut way of viewing the problem I'd be coding in... er... pretty much anything else. But one of the other benefits I'd lose out on as a result would be the ability to re-open a class and dynamically add a method like I did yesterday:<br />
[sourcecode language='ruby']<br />
class Object</p>
<p>  def in? collection<br />
    collection.include? self<br />
  end</p>
<p>end[/sourcecode]<br />
And now I can sleep again at night.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[RoR FrontController]]></title>
<link>http://newoldstuff.wordpress.com/?p=11</link>
<pubDate>Mon, 10 Mar 2008 19:57:08 +0000</pubDate>
<dc:creator>alinpopa</dc:creator>
<guid>http://newoldstuff.wordpress.com/?p=11</guid>
<description><![CDATA[Zilele trecute am dat de o situaţie în care am fost nevoit să folosesc un front controller.
Cam a]]></description>
<content:encoded><![CDATA[<p>Zilele trecute am dat de o situaţie în care am fost nevoit să folosesc un front controller.<br />
Cam aşa am facut (multumiri autorului postului <a href="http://www.agileprogrammer.com/dotnetguy/archive/2006/07/09/16917.aspx" target="_blank">original</a>):</p>
<div style="font-size:10px;font-weight:bold;"> # Să presupunem ca avem un controller numit Admin.<br />
class AdminController &#60; ApplicationController<br />
def process(request, response, method = :perform_action, *arguments)<br />
super(request, response, :index)<br />
end<br />
def index<br />
@req_host = request.env["HTTP_HOST"]<br />
@req_url = request.env["PATH_INFO"]<br />
find_controller.constantize.new.process(request, response)<br />
rescue NameError<br />
# Actiunea default care va fi folosită în caz ca nu există controller-ul specificat<br />
render :action =&#62; 'index'<br />
end    def find_controller<br />
controller = ""<br />
action = ""<br />
# URL-ul aşteptat va avea forma de mai jos (ex: /admin/mycontroller/myaction )<br />
if @req_url =~ /^\/(\w*\_*\w*)\/(\w*\_*\w*)\/*(\w*\_*\w*)$/<br />
controller = $2.to_s.downcase<br />
action = $3.to_s.downcase<br />
end<br />
if action.empty? &#38;&#38; !controller.empty?<br />
action = 'index'<br />
end<br />
params[:action] = action<br />
case controller<br />
when "admin_workshoptypes"<br />
# Numele clasei controller-ului va fi  returnată în caz că acesta a fost găsit<br />
return "AdminWorkshoptypesController"<br />
else<br />
# Dacă niciun controller nu a fost găsit, numele unui controller inexistent va fi returnat<br />
return "noController"<br />
end<br />
end</p>
<p>end</p></div>
<p>Dacă vom folosi: http://localhost:3000/admin/mycontroller/myaction,<br />
se va trece prin controller-ul de mai sus, apoi o redirectare va fi făcută către controller-ul "mycontroller" şi către acţiunea "myaction" aferentă acestuia.<br />
Spor la treaba.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[easy ?]]></title>
<link>http://newoldstuff.wordpress.com/?p=6</link>
<pubDate>Wed, 27 Feb 2008 09:20:39 +0000</pubDate>
<dc:creator>alinpopa</dc:creator>
<guid>http://newoldstuff.wordpress.com/?p=6</guid>
<description><![CDATA[using ruby 1.9, in order to get a character from a string using a specific position, you&#8217;ll do]]></description>
<content:encoded><![CDATA[<p>using ruby 1.9, in order to get a character from a string using a specific position, you'll do:</p>
<p><code style="font-size:10px;font-weight:bold;">irb(main):001:0&#62; "abc"[1]<br />
=&#62; "b"</code></p>
<p>but in ruby 1.8:</p>
<p><code style="font-size:10px;font-weight:bold;">irb(main):001:0&#62; "abc"[1..1]<br />
=&#62; "b"</code></p>
<p>There is an easier way, for 1.8, to do that?</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[to whom may concern...]]></title>
<link>http://newoldstuff.wordpress.com/2008/02/26/to-whom-may-concern/</link>
<pubDate>Tue, 26 Feb 2008 15:51:10 +0000</pubDate>
<dc:creator>alinpopa</dc:creator>
<guid>http://newoldstuff.wordpress.com/2008/02/26/to-whom-may-concern/</guid>
<description><![CDATA[New ruby book out there (also covers 1.9 version)

]]></description>
<content:encoded><![CDATA[<p>New <a href="http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177/">ruby book</a> out there (also covers 1.9 version)</p>
<p><a href="http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177/" title="the book" target="_blank"></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Gleisarbeiter-Blog ist umgezogen]]></title>
<link>http://gleisarbeiter.wordpress.com/2008/01/19/gleisarbeiter-blog-ist-umgezogen/</link>
<pubDate>Sat, 19 Jan 2008 11:11:27 +0000</pubDate>
<dc:creator>gleisarbeiter</dc:creator>
<guid>http://gleisarbeiter.wordpress.com/2008/01/19/gleisarbeiter-blog-ist-umgezogen/</guid>
<description><![CDATA[Ich habe meinen Blog jetzt auf meinen eigenen Server umgezogen.
www.gleisarbeiter.de
Der WordPress-B]]></description>
<content:encoded><![CDATA[<p>Ich habe meinen Blog jetzt auf meinen eigenen Server umgezogen.</p>
<p><a href="http://www.gleisarbeiter.de">www.gleisarbeiter.de</a></p>
<p>Der Wordpress-Blog selbst wird von mir nicht mehr aktualisiert. Schaut bitte jetzt unter dem neuen Link nach Neuigkeiten.</p>
<p>Viel Spaß!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Stemming mit ActsAsFerret]]></title>
<link>http://gleisarbeiter.wordpress.com/2008/01/17/stemming-mit-actsasferret/</link>
<pubDate>Thu, 17 Jan 2008 14:53:49 +0000</pubDate>
<dc:creator>gleisarbeiter</dc:creator>
<guid>http://gleisarbeiter.wordpress.com/2008/01/17/stemming-mit-actsasferret/</guid>
<description><![CDATA[Stemming ist ein Verfahren, um - mit Hilfe von Algorithmen - den Wortstamm von Wörtern zu ermitteln]]></description>
<content:encoded><![CDATA[<p>Stemming ist ein Verfahren, um - mit Hilfe von Algorithmen - den Wortstamm von Wörtern zu ermitteln. Dies wird z.B. bei Suchmaschinen angewendet, damit die Suche nicht an einem eingebenen Wort scheitert, dass zwar nicht in der Datenbank als solches zu finden ist, wohl aber dessen Wortstamm, z.B. Gitarren =&#62; Gitarre.</p>
<p>Ferret und ActsAsFerret bietet eine einfach zu konfigurierende Unterstützung für dieses Stemming:</p>
<p>Eine Datei</p>
<pre>stemming_analyzer.rb</pre>
<p>im lib/-Verzeichnis anlegen:</p>
<pre>
require 'rubygems'
require 'ferret'

class StemmingAnalyzer &#60; Ferret::Analysis::Analyzer
  include Ferret::Analysis
  def initialize(stop_words = FULL_GERMAN_STOP_WORDS)
    @stop_words = stop_words
  end
  def token_stream(field, str)
    StemFilter.new(StopFilter.new(LowerCaseFilter.new(StandardTokenizer.new(str)),@stop_words), 'de')
  end
end</pre>
<p>Im zu durchsuchenden Model dann folgendes:</p>
<pre>
acts_as_ferret :fields =&#62; {
  :bandname =&#62; {}, :firstName_if_public =&#62; {},
  :tag_list =&#62; {}, :comment_list =&#62; {}
}, :ferret =&#62; {
    :analyzer =&#62; StemmingAnalyzer.new, :remote =&#62; true}</pre>
<p>Dabei ist darauf zu achten, dass, wenn ihr den DrB-Server verwenden wollt, :remote =&#62; true innerhalb des :ferret-Attributs sein muss. Bei uns war dieses ausserhalb, woraufhin bei einem Aufruf von XYZ.rebuild_index nur nil zurückgeliefert wurde und Stemming nicht funktionierte.</p>
<p>Über script/console kann dann schön getestet werden. Wenn man nebenbei noch die log/ferret_server.log anschaut, kann man sehen, dass jetzt automatisch Suchwörter wie "und" in XYZ.find_by_contents("Gitarren und Geigen") entfernt werden. Ausserdem kann man sehen, dass z.B. "Geigen" auf "Geig" reduziert wird, womit sich dann auch Wörter wir Geige finden lassen.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Indiginox hat einen neuen Mitarbeiter!]]></title>
<link>http://gleisarbeiter.wordpress.com/2008/01/15/indiginox-hat-einen-neuen-mitarbeiter/</link>
<pubDate>Tue, 15 Jan 2008 07:09:16 +0000</pubDate>
<dc:creator>gleisarbeiter</dc:creator>
<guid>http://gleisarbeiter.wordpress.com/2008/01/15/indiginox-hat-einen-neuen-mitarbeiter/</guid>
<description><![CDATA[&#8230; und der heisst Aljoscha Everding.
Wenn er da ist, dann sitzt er genau hier, mir gegenüber,]]></description>
<content:encoded><![CDATA[<p>... und der heisst <a href="http://einheitzbrei.wordpress.com/2008/01/13/das-wagnis-paderborn/">Aljoscha Everding</a>.</p>
<p>Wenn er da ist, dann sitzt er genau hier, mir gegenüber, und wie man schon an seinen Stuhl-Armlehnen sehen kann, ist er nicht grad der kleinste :-) Aber ein total Netter. Gestern war der erste Tag und er durfte sich erstmal mit der Installation unseres Projektes ligx.de auf seinem neuen Macbook ausruhen. Heute kann er endlich zeigen was in ihm steckt :-D Aber das wird wohl kein Problem werden, schließlich hat er seine Diplomarbeit in RubyOnRails gemacht.</p>
<p>Also dann, auf eine gute Zusammenarbeit!</p>
<p><a><img src="http://gleisarbeiter.wordpress.com/files/2008/01/foto-1.thumbnail.jpg" alt="foto-1.jpg" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Flex &amp; RubyOnRails]]></title>
<link>http://gleisarbeiter.wordpress.com/2008/01/11/flex-rubyonrails/</link>
<pubDate>Fri, 11 Jan 2008 16:28:45 +0000</pubDate>
<dc:creator>gleisarbeiter</dc:creator>
<guid>http://gleisarbeiter.wordpress.com/2008/01/11/flex-rubyonrails/</guid>
<description><![CDATA[Onlinemusicstar.de ist jetzt Ligx.de und dazu noch mit Flash/Flex Oberfläche. Nachdem wir uns bei d]]></description>
<content:encoded><![CDATA[<p><a href="http://www.onlinemusicstar.de" target="_blank">Onlinemusicstar.de</a> ist jetzt <a href="http://www.ligx.de" target="_blank">Ligx.de</a> und dazu noch mit Flash/Flex Oberfläche. Nachdem wir uns bei der Umsetzung  vorerst auf HTML+RoR beschränkt hatten, ist aus diesem Projekt jetzt eine Flex+RoR-Anwendung geworden. Dabei wird auf Server-Seite das RailsPlugin WebORB verwendet, mit dem im J2EE-Stil Webservices zur Verfügung gestellt und diese dann von Flex aufgerufen werden können.Durch die Möglichkeiten des ClassMappings haben wir ausserdem die Möglichkeit RubyObjekte zwischen Flex und RoR hin- und herzuschicken, anstatt POST-Variablen oder xml-Daten, was doch alles sehr vereinfacht. Ein Beispiel:</p>
<div>def updateUserData(user_object)</div>
<div>    user_object.save</div>
<div>end</div>
<div></div>
<div>Diese Funktion speichert die persönlichen Daten eines Users ab. Das interessante daran ist, dass wir nicht etwas einen Block an Variablen erhalten (den wir dann über params[...] speichern müssten), sondern wir erhalten von der Flex-Seite ein User-Objekt, welches wir auch sofort speichern können und können genauso einfach Objekte (die über das Classmapping definiert wurden) zurückschicken.</div>
<div></div>
<div>Was dabei herauskommt sieht man auf <a href="http://www.ligx.de">www.ligx.de</a></div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Nice(r) Hash treatment for URLs ]]></title>
<link>http://jameshalberg.wordpress.com/2007/11/14/nicer-hash-treatment-for-urls/</link>
<pubDate>Wed, 14 Nov 2007 03:53:08 +0000</pubDate>
<dc:creator>Jim</dc:creator>
<guid>http://jameshalberg.wordpress.com/2007/11/14/nicer-hash-treatment-for-urls/</guid>
<description><![CDATA[Isn&#8217;t it nice how Rails lets you add form elements using the convention:
store[manager] = Bob ]]></description>
<content:encoded><![CDATA[<p>Isn't it nice how Rails lets you add form elements using the convention:</p>
<p>store[manager] = Bob Smith<br />
store[location][state] = Wisconsin<br />
store[location][zip] = 53590</p>
<p>And easily process them on the server side with something like:<br />
Store.new(params[:store])</p>
<p>So, why does this:<br />
link_to "Store", :controller =&#62; :store, :action =&#62; :show, :store =&#62; { :manager =&#62; "Bob Smith", :location =&#62; { :state =&#62; "Wisconsin", :zip =&#62; 53590 } }</p>
<p>output something stupid like this:<br />
http://localhost:3000/case/1/store/show?store=locationstateWisconsinzip53590managerBob+Smith</p>
<p>when what I'd like is something like:<br />
http://localhost:3000/store/show?store%5Blocation%5D%5Bstate%5D=Wisconsin&#38;store%5Blocation%5D%5Bzip%5D=53590&#38;store%5Bmanager%5D=Bob+Smith</p>
<p>Well, without further ado, I give you the url_for hack to make it happen (note: For a widespread solution this would need to do a bit more... escape things, handle some different object types, handle more than 1 layer of hashed values, etc... but you get the idea)</p>
<p><a href="http://jameshalberg.wordpress.com/files/2007/11/url_for_hack2.png" title="url_for_hack2.png"><img src="http://jameshalberg.wordpress.com/files/2007/11/url_for_hack2.png" alt="url_for_hack2.png" /></a></p>
<p>Putting this in url_for has other benefits since lots of things depend on it.  For example, now you can do:</p>
<p>redirect_to :action =&#62; :show,  :store =&#62; { :manager =&#62; "Bob Smith", :location =&#62; { :state =&#62; "Wisconsin", :zip =&#62; 53590 } }</p>
<p>This is especially handy if you'd like an action to "hand off" some of the params that it's received via a redirect.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[First day at RailsConfEurope - BratwurstOnRails]]></title>
<link>http://gleisarbeiter.wordpress.com/2007/09/17/first-day-at-railsconfeurope-bratwurstonrails/</link>
<pubDate>Mon, 17 Sep 2007 06:10:08 +0000</pubDate>
<dc:creator>gleisarbeiter</dc:creator>
<guid>http://gleisarbeiter.wordpress.com/2007/09/17/first-day-at-railsconfeurope-bratwurstonrails/</guid>
<description><![CDATA[Gestern war der erste Tag (inoffizielle) RailsConf-Tag: BratwurstOnRails. Die Berliner Rails-User-Gr]]></description>
<content:encoded><![CDATA[<p>Gestern war der erste Tag (inoffizielle) RailsConf-Tag: BratwurstOnRails. Die Berliner Rails-User-Group hatte einen fröhlichen Grillabend organisiert der wie das Foto zeigt auch gut besucht wurde.</p>
<p><a href="http://gleisarbeiter.wordpress.com/files/2007/09/bild003.jpg" title="bild003.jpg"><img src="http://gleisarbeiter.wordpress.com/files/2007/09/bild003.thumbnail.jpg" alt="bild003.jpg" /></a><a href="void(0)" id="file-link-32" title="bild005.jpg" class="file-link image"> 			 <img src="http://gleisarbeiter.wordpress.com/files/2007/09/bild005.thumbnail.jpg" alt="bild005.jpg" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[RailConf 2007 in Berlin]]></title>
<link>http://gleisarbeiter.wordpress.com/2007/09/15/railconf-2007-in-berlin/</link>
<pubDate>Sat, 15 Sep 2007 11:18:02 +0000</pubDate>
<dc:creator>gleisarbeiter</dc:creator>
<guid>http://gleisarbeiter.wordpress.com/2007/09/15/railconf-2007-in-berlin/</guid>
<description><![CDATA[


Morgen nachmittag gehts los mit dem ICE zur RailsConfEurope in Berlin. Wirklich interessante Them]]></description>
<content:encoded><![CDATA[<p><a href="http://www.railsconfeurope.com"><br />
<img src="http://conferences.oreillynet.com/images/railseurope2007/banners/468x60.jpg" width="468" height="60" border="0" alt="RailsConf Europe 2007" /><br />
</a></p>
<p>Morgen nachmittag gehts los mit dem ICE zur RailsConfEurope in Berlin. Wirklich interessante Themen und Tutorials stehen an und natürlich BratwurstOnRails morgen abend ;-)</p>
<p>See you at RailsConf!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Rails Functionality Tests mit Goldberg]]></title>
<link>http://gleisarbeiter.wordpress.com/2007/08/30/rails-functionality-tests-mit-goldberg/</link>
<pubDate>Thu, 30 Aug 2007 06:52:23 +0000</pubDate>
<dc:creator>gleisarbeiter</dc:creator>
<guid>http://gleisarbeiter.wordpress.com/2007/08/30/rails-functionality-tests-mit-goldberg/</guid>
<description><![CDATA[Nach dem ich mich jetzt so einige Zeit mit dem Testen von Railsapplikationen beschäftige, habe ich ]]></description>
<content:encoded><![CDATA[<p>Nach dem ich mich jetzt so einige Zeit mit dem Testen von Railsapplikationen beschäftige, habe ich wieder etwas Interessantes herausgefunden.</p>
<p>Wie kann ich meine Goldberg-Tabelleninhalte möglichst einfach in meine Testdatenbank laden?</p>
<p>Eigentlich ganz einfach:</p>
<p>Im Rails_Root</p>
<pre>rake goldberg:dump_bootstrap</pre>
<p>aufrufen, damit werden die Tabelleninhalte von Goldberg in das Verzeichnis vendor/plugins/goldberg/db gedumpt und zwar im yml-Format.</p>
<p>In den Functionality/Unit-Tests z.B. in der setup Methode einfach den Befehl</p>
<pre>GoldbergMigration.load_bootstrap</pre>
<p>aufrufen und die Test-Tabellen werden mit den aktuellen Goldbergdaten gefüllt.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Ruby on Rails untuk UKM]]></title>
<link>http://lukmansalim.wordpress.com/2007/08/18/ruby-on-rails-untuk-ukm/</link>
<pubDate>Sat, 18 Aug 2007 04:41:52 +0000</pubDate>
<dc:creator>lukmansalim</dc:creator>
<guid>http://lukmansalim.wordpress.com/2007/08/18/ruby-on-rails-untuk-ukm/</guid>
<description><![CDATA[Saya kira Ruby on Rails (RoR) sangat cocok untuk UKM. Mengapa demikian? Mari kita lihat kelebihan-ke]]></description>
<content:encoded><![CDATA[<p>Saya kira <a href="http://www.rubyonrails.org" target="_blank">Ruby on Rails</a> (RoR) sangat cocok untuk UKM. Mengapa demikian? Mari kita lihat kelebihan-kelebihan RoR:</p>
<p>Dari sisi pengguna, keunggulan RoR adalah:</p>
<ol>
<li>RoR dapat menggunakan 100% <em>open source software</em>, sehingga biaya pembelian lisensi dapat ditekan sampai 0.</li>
<li>RoR tidak membutuhkan perangkat keras yang mahal</li>
<li>RoR dapat menggunakan model bisnis persewaan (SaaS, <em>software as a service</em>) dengan biaya awal yang kecil</li>
</ol>
<p>OK, semua poin di atas berlaku juga untuk <em>open source web development platform</em> yang lainnya, seperti PHP, Perl dan lain-lain, nah keunggulan utama RoR dibandingkan dengan platform  lain adalah:</p>
<ol>
<li>RoR sangat mendukung "<em>software engineering best practices</em>" yang sering diabaikan oleh pengguna platform lainnya, sehingga produk aplikasi RoR cenderung lebih berkualitas dan lebih sedikit cacatnya (bug).</li>
<li>RoR memiliki waktu pengembangan yang paling singkat, sehingga biaya pengadaan aplikasi pun tentunya dapat ditekan</li>
<li>RoR memiliki tingkat keluwesan yang tinggi (<em>high agility</em>) sehingga lebih mudah beradaptasi dengan business process yang sering berubah-ubah</li>
<li>RoR lebih mudah dipelihara karena keringkasannya. Bukan hanya pengembangan aplikasi yang berbanding lurus (bahkan berbanding exponensial) dengan banyaknya <em>source code</em> (kode sumber), pemeliharaan pun biasanya seperti itu juga.</li>
<li>Hampir semua UKM tentunya berkeinginan untuk tumbuh pesat dan "lulus" dari UKM. Nah dengan sifat RoR yang <em>database independent</em>, maka transisi menuju database yang lebih canggih (misalnya Oracle atau DB2) akan lebih mulus, tidak banyak (atau bahkan tidak ada sama sekali) yang harus diubah dari sisi aplikasi ketika bisnis kita menuntut penggunaan database yang lebih canggih.</li>
</ol>
<p>Nah, bukankan sudah saatnya kita mengkampanyekan penggunaan RoR sebagai teknologi pilihan untuk UKM?</p>
<p>Besok saya akan membahas keunggulan RoR bagi UKM sebagai produsen software, ya, para software house kecil dan menengah.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[RoR vs. Web Forms vs. MonoRail Pt2]]></title>
<link>http://benl.wordpress.com/2007/06/01/ror-vs-web-forms-vs-monorail-pt2/</link>
<pubDate>Fri, 01 Jun 2007 12:01:55 +0000</pubDate>
<dc:creator>benl</dc:creator>
<guid>http://benl.wordpress.com/2007/06/01/ror-vs-web-forms-vs-monorail-pt2/</guid>
<description><![CDATA[Ok so in the last post I talked about some of the more obvious issues I have with ASP.NET and web fo]]></description>
<content:encoded><![CDATA[<p>Ok so in the <a href="http://benl.wordpress.com/2007/05/31/ror-vs-web-forms-vs-monorail/">last post</a> I talked about some of the more obvious issues I have with ASP.NET and web forms development. Thankfully, the <a href="http://www.castleproject.org/monorail/index.html" target="_blank">Castle Project's MonoRail</a> framework goes some way to alleviating that pain.</p>
<h3>The Positives</h3>
<p><strong>MVC, MVP, ABC easy as 123...</strong></p>
<p>Under the covers, MonoRail is a full MVC compliant framework essentially comprising a front controller sitting over the ASP.NET infrastructure intercepting specially formed URI's. The HTML ends up in the browser  via your choice of view engine, with NVelocity (a fork of the Jakarta Velocity port) the default and most accessible, Brail being the Boo dynamic language and most performant option and of course a cruddy web forms engine too which nobody should use. :) I've been comfortably using NVelocity for a while now, and provide testament that its not difficult to pick up.</p>
<p>The controller code orchestrates the flow of logic through the application and rails URI's map nicely to actions on the controller which are ultimately public methods on the controller class itself. All nice and easy. Actions exposed on controllers derived from the magical <em>SmartDispatcherController</em> can translate posted form values into domain model objects for you by simply adding the <em>DataBind</em> attribute to your action's argument list:</p>
<pre><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> Save([<span style="color:#2b91af;">DataBind</span>(<span style="color:#a31515;">"publisher"</span>)] <span style="color:#2b91af;">Publisher</span> publisher)</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>In the above example the publisher argument is passed into the <em>Save</em> action fully constructed via the form or query string values posted! This saves on the usual binding and scraping stuff you normally do in web forms and which almost always ends up sitting in the code behind untested. Note: the databinding stuff is of course very flexible and my example above just touches on the possibilities.</p>
<p><strong>ActiveRecord</strong></p>
<p>The model can be supplied with an <a href="http://www.castleproject.org/activerecord/index.html" target="_blank">ActiveRecord</a> enabled domain model. This of course abstracts away NHibernate behind the scenes. <strike>Unfortunately generic collections support doesn't work right now but I believe that work is firmly underway</strike>.</p>
<p>Edit: Generic collections are supported, as long as you're running from the trunk.</p>
<p>Domain entities are adorned with the necessary attributes defining how their properties are mapped to your data source. This is a departure from the usual hbm XML mapping files but just as expressive.</p>
<p>ActiveRecord also supplies simple validation in the form of special attributes including email validation, regular expression validation and the like.</p>
<p><strong>UI Components</strong></p>
<p>Reusability of UI components is achieved via <em>ViewComponent</em>. These can support nested sections, parameters etc.</p>
<p><strong>AJAX and client scripting support</strong></p>
<p>Built into MonoRail are a number of helpers which allow you to perform the usual AJAX stuff such as calling remote server side methods and callback support, Scriptaculous and Effects2 client side goodness. In fact the helper extensibility is a nice way of adding extensions and wrapping commonly performed functionality in the view.</p>
<p><strong>Convention over configuration</strong></p>
<p>Like RoR, MonoRail prefers convention over configuration. The project structure skeleton is the same throughout all MonoRail enabled solutions. The MonoRail installer also includes a handy templated solution provider for both VS.NET 2003 and 2005 to create the project skeleton and testing is included. Accustomed MonoRail developers can open any solution and just know where things are going to be.</p>
<p><strong>Testability</strong></p>
<p>One of the sore points of ASP.NET development was the unit testing difficulty. MonoRail overcomes this by enforcing the MVC pattern. Controllers are testable classes sitting outside of the usual ASP.NET cruft. There are a number of framework features within MonoRail which specifically aid testing.</p>
<p><strong>Scaffolding</strong></p>
<p>Like RoR, controllers adorned with the necessary scaffolding attributes can automatically produce the basic markup and logic for CRUD operations on your domain model. Handy for prototyping or creating rough-and-ready data entry capabilities in your applications.</p>
<p><strong>Container support</strong></p>
<p>MonoRail supports IoC via the <a href="http://www.castleproject.org/container/index.html" target="_blank">Windsor container</a>. Controllers and their dependencies/parameters can be injected by the container if necessary.</p>
<h3><strong>The negatives</strong></h3>
<p>MonoRail does have some negatives, which I will mull over:</p>
<p><strong>No 3rd party or ASP.NET web forms controls support</strong></p>
<p>I don't really see this as an issue but can see that some ASP.NET developers will. Fans of the big UI library packages will complain, but there is this <em>old concept of HTML</em> and it is surprising how flexible it can be ;) Most use of control libraries I have seen has been misguided, by this I mean they're usually added to a screen just <em>because they can.</em></p>
<p>The web forms control library isn't such an issue as things like calendars, grids and the like are not to difficult to duplicate the MonoRail way.</p>
<p><strong>Learning a whole bunch of new concepts/patterns/practices</strong></p>
<p>Most ASP.NET developers are what can only be described as morts. They're not familiar with design patterns and good practices such as clean separation since they came from either ASP or VB (procedural backgrounds) so this stuff doesn't come naturally. If you've used NHibernate you'll pick up the ActiveRecord stuff in no time. Learning the template syntax for your chosen view engine is of course another consideration.</p>
<h3><font color="#000000">Summary</font></h3>
<p>In summary, the benefits of using MonoRail over web forms are clear. Clean separation of concerns, testability, reduced complexity and none of the web form cruft and artifacts. MonoRail won't suit everybody, but even if you're happy with web forms it's definitely worth a look. Personally I think its the only way worth programming in the enterprise with ASP.NET today.</p>
]]></content:encoded>
</item>

</channel>
</rss>
