<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Jeevika</title>
	<atom:link href="http://mkjeevika.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mkjeevika.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 12 Nov 2010 10:27:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mkjeevika.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Jeevika</title>
		<link>http://mkjeevika.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mkjeevika.wordpress.com/osd.xml" title="Jeevika" />
	<atom:link rel='hub' href='http://mkjeevika.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to Check If Someone is Invisible, Offline Or Blocked You On GTalk</title>
		<link>http://mkjeevika.wordpress.com/2010/11/12/how-to-check-if-someone-is-invisible-offline-or-blocked-you-on%c2%a0gtalk/</link>
		<comments>http://mkjeevika.wordpress.com/2010/11/12/how-to-check-if-someone-is-invisible-offline-or-blocked-you-on%c2%a0gtalk/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 04:54:57 +0000</pubDate>
		<dc:creator>Jeevika</dc:creator>
				<category><![CDATA[Blocked You On GTalk]]></category>
		<category><![CDATA[blocked]]></category>
		<category><![CDATA[Gtalk]]></category>
		<category><![CDATA[How to Check If Someone is Invisible]]></category>
		<category><![CDATA[Invisible]]></category>
		<category><![CDATA[Jeevika]]></category>
		<category><![CDATA[Offline]]></category>
		<category><![CDATA[Offline Or Blocked You On GTalk]]></category>

		<guid isPermaLink="false">http://mkjeevika.wordpress.com/?p=10</guid>
		<description><![CDATA[GTalk is one of the most used messaging services on internet. Initially Gtalk was not having any invisible option in it. Which means you will get noticed by all your friends once you log in. But later, after a lots of requests from it’s users, GTalk decided to start this invisible feature. But, they started [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=10&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><span style="font-weight:normal;font-size:13px;"><a href="http://www.google.com/talk" target="_blank">GTalk</a> is one of the most used messaging services on internet. </span></h1>
<p>Initially Gtalk was not having any invisible option in it. Which means you will get noticed by all your friends once you log in. But later, after a lots of requests from it’s users, GTalk decided to start this invisible feature. But, they started this invisible feature for those who uses GTalk from GMail or Orkut. If you are using GTalk from your desktop, you may not get this facility.</p>
<p><a href="http://www.solidblogger.com/wp-content/uploads/2009/01/gtalk.png"></a></p>
<p>In this post I will guide you with three things that you might find interesting. You can consider these as GTalk tricks. And the three things are:</p>
<ol>
<li>How to know if someone is invisible on GTalk.</li>
<li>How to know if someone is offline or not.</li>
<li>How to know if someone has blocked you on Gtalk or not.</li>
</ol>
<p>Lets get started step by step. I am sure, you will have fun reading these Gtalk tricks.</p>
<h3><span style="text-decoration:underline;">How To Know if Someone is Invisible or Offline on GTalk</span> :</h3>
<p>People activate this invisible feature for many reasons. They might be busy or do not want anyone to disturb them. They want to chat with few people they want or they want to stay hidden and contact the persons they wish. I always stay invisible on Gtalk, so that I can talk with the persons I want</p>
<p>Now if you want to fool the people and know about their online status even when they have logged in with invisible feature activated, then this is possible. Poor Gtalk! There are two ways to do this.</p>
<ul>
<li>After  the Gtalk  installation, log on to your GTalk account with your login details.</li>
<li>Now, this will show you the entire online friends list. It does not matter if they are online or invisible.</li>
<li>In this way you can catch your offline friends as well. The persons who are being shown as offline, are not present on GTalk.</li>
<li>And you are done above. You will notice those online (visible + invisible) as well as the offline friends.</li>
</ul>
<p>And the second method  is :</p>
<ul>
<li>Set the chat as <strong>off the record</strong> with target user. This can be done only when the other user is online.<a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;answer=29291"><em><br />
</em></a></li>
<li>Now try sending chat to that user when he is invisible or offline.</li>
<li>If he is invisible, then he will receive chat.</li>
<li>But if he Is offline, then you will receive error <strong>“&lt;username&gt; did not receive your chat”</strong>.</li>
</ul>
<h3><span style="text-decoration:underline;">How to Know if Someone Has Blocked You on Gtalk</span> :</h3>
<p>Now this is worth exciting. Few times we notice friends not contacting us for a long time. Even though we send them messages, they never reply us back. It can happen because of three reasons.</p>
<p>He/She is avoiding  or offline blocked you on Gtalk.</p>
<p>Whatever the reson may be, it’s nice to find the reason yourself. Let’s find out the exact reason of not getting a reply back. But for this you need to have <strong>PIDGIN</strong> and configure it properly. Pidgin is a third party tool, available for free. You can use all your messenger accounts at once using this software. You can talk to your friends using AIM, ICQ, Jabber/XMPP, MSN Messenger, Yahoo!, Google Talk, Bonjour, Gadu-Gadu, IRC, Novell GroupWise Messenger, QQ, Lotus Sametime, SILC, SIMPLE, MySpaceIM, Zephyr etc. Read the below steps properly.</p>
<p><em><span style="text-decoration:underline;">How to configure PIDGIN for GTalk</span></em><em><span style="text-decoration:underline;"> </span></em><em>:</em></p>
<ul>
<li> Download <a href="http://pidgin.im/download/" target="_blank">Pidgin</a>.</li>
<li>Go To <strong>Accounts –&gt; Manage –&gt; Add.</strong></li>
<li>It will open a new window <strong>Add Accounts</strong>.</li>
<li>From the drop down box choose <strong>XMPP</strong> as the Protocol.</li>
<li>In case of Screen name enter your <strong>Gmail Id</strong> (<em>e.g. – solid.blogger</em>).</li>
<li>Type <strong>gmail.com</strong> as the Domain/Server.</li>
<li>In Resource Field enter <strong>Home</strong>.</li>
<li>Type your Gmail Password in the Password Field.</li>
<li>Choose any Nickname (<em>e.g. – Bapun</em>) as Local alias.</li>
</ul>
<p><a href="http://www.solidblogger.com/wp-content/uploads/2009/01/configure-pidgin-with-gtalk.jpg"></a></p>
<p>And you are done with Pidgin settings. Now lets play with Pidgin to find those GTalk contacts who has blocked you. For this follow the below mentioned steps.</p>
<p>1. sign in to GTalk on PIDGIN with your details</p>
<p>2. Go to <strong>Buddies</strong> –&gt; <strong>Show Offline Buddies</strong> (The person who has blocked you is being shown as offline to you. So, in this way you can catch him.)</p>
<p><a href="http://www.solidblogger.com/wp-content/uploads/2009/01/who-blocked-you-on-gtalk.jpg"></a></p>
<p>3. Now all available contacts will be visible to you. Select any one contact from that list.</p>
<p>4. Right click on that selected contact, and click on <strong>Get Info</strong>.</p>
<p><a href="http://www.solidblogger.com/wp-content/uploads/2009/01/who-has-blocked-you-on-google-talk.jpg"></a></p>
<p>5. Now here is the twist. Clicking on <strong>Get Info</strong><strong> </strong>will show the brief profile of the person. But now if the person has blocked you on Google Talk, you won’t be able to see his/her full profile. You can’t even see his/her profile name.</p>
<p><a href="http://www.solidblogger.com/wp-content/uploads/2009/01/know-if-someone-blocked-you-on-gtalk.jpg"></a></p>
<p>This is the best way to know if someone has blocked you on google talk or not. If he has blocked you, then he will appear to you forever.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mkjeevika.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mkjeevika.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mkjeevika.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mkjeevika.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mkjeevika.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mkjeevika.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mkjeevika.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mkjeevika.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mkjeevika.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mkjeevika.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mkjeevika.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mkjeevika.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mkjeevika.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mkjeevika.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=10&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mkjeevika.wordpress.com/2010/11/12/how-to-check-if-someone-is-invisible-offline-or-blocked-you-on%c2%a0gtalk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f6ae9b692f1f10d52af05656fa66f8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeevika</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight with Ruby on Rails</title>
		<link>http://mkjeevika.wordpress.com/2008/04/17/silverlight-with-ruby-on-rails/</link>
		<comments>http://mkjeevika.wordpress.com/2008/04/17/silverlight-with-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 08:09:19 +0000</pubDate>
		<dc:creator>Jeevika</dc:creator>
				<category><![CDATA[Silverlight with RoR]]></category>
		<category><![CDATA[Silverlight with Ruby on Rails]]></category>

		<guid isPermaLink="false">http://mkjeevika.wordpress.com/?p=6</guid>
		<description><![CDATA[Using Silverlight with Ruby on Rails In this post I will be showing a really simple example of creating a Silverlight frontend for a Rails backend. This is what I think will be a three part series comparing Silverlight with Flex. The steps will be: Creating a Rails application. Creating a frontend for it in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=6&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="post-75" class="post">
<h2><a title="Permanent Link to Using Silverlight with Ruby on Rails" rel="bookmark" href="http://techblogging.wordpress.com/2008/03/26/using-silverlight-with-rubyonrails/">Using Silverlight with Ruby on Rails</a></h2>
<p>In this post I will be showing a really simple example of creating a Silverlight frontend for a Rails backend. This is what I think will be a three part series comparing Silverlight with Flex.</p>
<div class="entrytext">
<div class="snap_preview">
<p>The steps will be:</p>
<ol>
<li>Creating a Rails application.</li>
<li>Creating a frontend for it in silverlight.</li>
<li>Creating a frontend for it in Flex.</li>
<li>Comparing the approaches taken in both the frontends.</li>
</ol>
<p>I will try to keep changes in the backend Rails application to a minimum.</p>
<h5><span style="text-decoration:underline;">Creating a Rails Application</span></h5>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">F:\<span style="color:#0000ff;">&gt;</span>rails test
F:\<span style="color:#0000ff;">&gt;</span>cd test
F:\test<span style="color:#0000ff;">&gt;</span>ruby script\generate scaffold user name:string address:text
F:\test<span style="color:#0000ff;">&gt;</span>rake db:create
F:\test<span style="color:#0000ff;">&gt;</span>rake db:migrate
F:\test<span style="color:#0000ff;">&gt;</span>ruby script\server</pre>
</div>
<p>Before running the migrations add the following code in the first migration file (./db/migrate/001_create_users.rb) to create some initial data.  So it should look like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">class</span> CreateUsers &lt; ActiveRecord::Migration
def self.up
create_table :users <span style="color:#0000ff;">do</span> |t|
t.<span style="color:#0000ff;">string</span> :name
t.text :address
t.timestamps
end

User.create(:name=&gt; <span style="color:#006080;">“Gaurav”</span>, :address=&gt; <span style="color:#006080;">“Gaurav’s address”</span>)
User.create(:name=&gt; <span style="color:#006080;">“Rishav”</span>, :address=&gt; <span style="color:#006080;">“Rishav’s address”</span>)
User.create(:name=&gt; <span style="color:#006080;">“Bhavesh”</span>, :address=&gt; <span style="color:#006080;">“Bhavesh’s address”</span>)
end

def self.down
drop_table :users
end
end</pre>
</div>
<h5><span style="text-decoration:underline;">Creating a new C# based Silverlight project</span></h5>
<p>Open up Visual Studio 2008 (with Silverlight <a href="http://techblogging.wordpress.com/2008/03/05/silverlight-20-beta-1-now-available-and-10-version-ported-to-nokia-mobiles/">tools</a> installed. You can also download a trial version of Visual Studio 2008 from <a href="http://msdn2.microsoft.com/en-us/vstudio/products/aa700831.aspx">here</a>). And create a new project:</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/vs-step1.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/vs-step1-thumb.png?w=609&#038;h=415&#038;h=415" border="0" alt="vs_step1" width="609" height="415" /></a></p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/vs-step2.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/vs-step2-thumb.png?w=439&#038;h=368&#038;h=368" border="0" alt="vs_step2" width="439" height="368" /></a></p>
<p>Open the page.xaml file and add a ListBox to it. It should look like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">UserControl</span> <span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">=”TestFrontEnd.Page”</span>
<span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=”http://schemas.microsoft.com/client/2007″</span>
<span style="color:#ff0000;">xmlns <img class="wp-smiley" src="http://techblogging.wordpress.com/wp-includes/images/smilies/icon_mad.gif" alt="x" /> </span><span style="color:#0000ff;">=”http://schemas.microsoft.com/winfx/2006/xaml”</span>
<span style="color:#ff0000;">Width</span><span style="color:#0000ff;">=”400″</span> <span style="color:#ff0000;">Height</span><span style="color:#0000ff;">=”300″</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Grid</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”LayoutRoot”</span> <span style="color:#ff0000;">Background</span><span style="color:#0000ff;">=”White”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ListBox</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userList”</span> <span style="color:#ff0000;">Height</span><span style="color:#0000ff;">=”200″</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Grid</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">UserControl</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>Now when the server responds with xml, we will parse that using <a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx">Linq</a>. For that we need a User class that is like the user model on the Rails side. So it should have 3 fields:</p>
<ol>
<li>id</li>
<li>name</li>
<li>address</li>
</ol>
<p>It should look like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">namespace</span> TestFrontEnd {
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> User {
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> id { get; set; }
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> name { get; set; }
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> address { get; set; }
}
}</pre>
</div>
<p>To make things simpler I have created a HTTPService class that behaves something like the Flex based HTTPService class. <a href="http://pastie.caboo.se/170803">Here is the source</a> (too big to paste inline). Add it to your project. You will need to include System.Net assembly your project to to make it work. Its usage is quite simple.</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">HTTPService userIndexService = <span style="color:#0000ff;">new</span> HTTPService();
userIndexService.Url = <span style="color:#006080;">“http://localhost:3000/users.xml”</span>;
userIndexService.ServiceComplete += <span style="color:#0000ff;">new</span> HttpServiceCompleteEventHandler(userIndexService_ServiceComplete);
userIndexService.send();</pre>
</div>
<p>You can also give the request method like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">userIndexService.Method = <span style="color:#006080;">“POST”</span>;</pre>
</div>
<p>Now add an ObservableCollection to the Page class:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">private</span> ObservableCollection&lt;User&gt; userListItems = <span style="color:#0000ff;">new</span> ObservableCollection&lt;User&gt;();</pre>
</div>
<p>We will be using this for <a href="http://msdn2.microsoft.com/en-us/library/ms752347.aspx">databinding</a> with the ListBox to display all the users.</p>
<p>Add the System.Xml.Linq to your project. In the userIndexService_ServiceComplete event handler write:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">void</span> userIndexService_ServiceComplete(HttpServiceCompleteEventArgs e) {
XDocument users = XDocument.Parse(e.Response);
User[] usersList = (from x <span style="color:#0000ff;">in</span> users.Descendants(<span style="color:#006080;">“user”</span>)
select <span style="color:#0000ff;">new</span> User
{
id = <span style="color:#0000ff;">int</span>.Parse(x.Descendants(<span style="color:#006080;">“id”</span>).First().Value),
name = x.Descendants(<span style="color:#006080;">“name”</span>).First().Value,
address = x.Descendants(<span style="color:#006080;">“address”</span>).First().Value,
}).ToArray();
<span style="color:#0000ff;">foreach</span> (User user <span style="color:#0000ff;">in</span> usersList)
userListItems.Add(user);
}</pre>
</div>
<p>So when the service completes all the users will be filled in the ObserveableCollection. Now to bind it to the userList ListBox. In the constructor of the Page class write:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">userList.DataContext = userListItems;</pre>
</div>
<p>And modify the code for the userList ListBox to look like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ListBox</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userList”</span> <span style="color:#ff0000;">Height</span><span style="color:#0000ff;">=”200″</span> <span style="color:#ff0000;">ItemsSource</span><span style="color:#0000ff;">=”{Binding}”</span> <span style="color:#ff0000;">DisplayMemberPath</span><span style="color:#0000ff;">=”name”</span> <span style="color:#0000ff;">/&gt;</span></pre>
</div>
<p>Add a crossdomain.xml file to the rails project’s public folder:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;?</span><span style="color:#800000;">xml</span> <span style="color:#ff0000;">version</span><span style="color:#0000ff;">=”1.0″</span>?<span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;!</span><span style="color:#800000;">DOCTYPE</span> <span style="color:#ff0000;">cross-domain-policy</span> <span style="color:#ff0000;">SYSTEM</span> <span style="color:#0000ff;">“http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">cross-domain-policy</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">allow-access-from</span> <span style="color:#ff0000;">domain</span><span style="color:#0000ff;">=”*”</span> <span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">cross-domain-policy</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>We are basically allowing our Silverlight app to access the rails server. You won’t be requiring this file if the Rails server is serving the Silverlight application, but currently it is not the case.</p>
<p>Now when you run the code you should see:</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/vs-step3.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/vs-step3-thumb.png?w=480&#038;h=416&#038;h=416" border="0" alt="vs_step3" width="480" height="416" /></a></p>
<p>Now I will add a few more lines of code to show the selected item in TextBox. Add/Update the following to page.xaml:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ListBox</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userList”</span> <span style="color:#ff0000;">Height</span><span style="color:#0000ff;">=”200″</span> <span style="color:#ff0000;">ItemsSource</span><span style="color:#0000ff;">=”{Binding}”</span> <span style="color:#ff0000;">DisplayMemberPath</span><span style="color:#0000ff;">=”name”</span> <span style="color:#ff0000;">SelectionChanged</span><span style="color:#0000ff;">=”userList_SelectionChanged”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">StackPanel</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”controls”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=”{Binding name, Mode=Twoway}”</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userName”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=”{Binding address, Mode=Twoway}”</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userAddress”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">StackPanel</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>The first TextBox is showing name and second is showing the password. The binding mode is set to TwoWay so that the changes in TextBox are automatically to the userListItems.</p>
<p>Add the corresponding event handler to Page class:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> userList_SelectionChanged(<span style="color:#0000ff;">object</span> sender, SelectionChangedEventArgs e) {
controls.DataContext = userList.SelectedItem <span style="color:#0000ff;">as</span> User;
}</pre>
</div>
<p>Now when you run the code you should see:</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/image6.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/image-thumb6.png?w=481&#038;h=423&#038;h=423" border="0" alt="image" width="481" height="423" /></a></p>
<p>Download the code upto this point:</p>
<ul>
<li><a href="http://cid-49208a72e4eb818c.skydrive.live.com/self.aspx/world/code/test.rar">Rails code</a></li>
<li><a href="http://cid-49208a72e4eb818c.skydrive.live.com/self.aspx/world/code/TestFrontEnd.rar">Silverlight code</a></li>
</ul>
<h5><span style="text-decoration:underline;">Implementing the full <a href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete">CRUD</a> :</span></h5>
<p>Firstly I willl be doing a bit of refactoring. Move the xml parsing code using Linq to the User class. So it should now look like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> User {
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> id { get; set; }
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> name { get; set; }
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> address { get; set; }

<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> User[] users_from_xml(String xml_string){
XDocument users = XDocument.Parse(xml_string);
<span style="color:#0000ff;">return</span> (from x <span style="color:#0000ff;">in</span> users.Descendants(<span style="color:#006080;">“user”</span>)
select <span style="color:#0000ff;">new</span> User
{
id = <span style="color:#0000ff;">int</span>.Parse(x.Descendants(<span style="color:#006080;">“id”</span>).First().Value),
name = x.Descendants(<span style="color:#006080;">“name”</span>).First().Value,
address = x.Descendants(<span style="color:#006080;">“address”</span>).First().Value,
}).ToArray();
}

<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> User user_from_xml(String xml_string) {
<span style="color:#0000ff;">return</span> users_from_xml(xml_string).First();
}
}</pre>
</div>
<p>Change the Page class to:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">using</span> System;
<span style="color:#0000ff;">using</span> System.Collections.Generic;
<span style="color:#0000ff;">using</span> System.Linq;
<span style="color:#0000ff;">using</span> System.Windows;
<span style="color:#0000ff;">using</span> System.Windows.Controls;
<span style="color:#0000ff;">using</span> System.Windows.Documents;
<span style="color:#0000ff;">using</span> System.Windows.Input;
<span style="color:#0000ff;">using</span> System.Windows.Media;
<span style="color:#0000ff;">using</span> System.Windows.Media.Animation;
<span style="color:#0000ff;">using</span> System.Windows.Shapes;
<span style="color:#0000ff;">using</span> System.Collections.ObjectModel;
<span style="color:#0000ff;">using</span> System.Xml.Linq;

<span style="color:#0000ff;">namespace</span> TestFrontEnd {
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">partial</span> <span style="color:#0000ff;">class</span> Page : UserControl {
<span style="color:#0000ff;">private</span> ObservableCollection&lt;User&gt; userListItems = <span style="color:#0000ff;">new</span> ObservableCollection&lt;User&gt;();

<span style="color:#0000ff;">private</span> HTTPService userIndexService;
<span style="color:#0000ff;">private</span> HTTPService userCreateService;
<span style="color:#0000ff;">private</span> HTTPService userUpdateService;
<span style="color:#0000ff;">private</span> HTTPService userDeleteService;

<span style="color:#0000ff;">public</span> Page() {
InitializeComponent();
<span style="color:#008000;">// setting the databinding</span>
userList.DataContext = userListItems;
controls.DataContext = <span style="color:#0000ff;">new</span> User();

<span style="color:#008000;">// service to get all te users form the server</span>
userIndexService = <span style="color:#0000ff;">new</span> HTTPService();
userIndexService.Url = <span style="color:#006080;">“http://localhost:3000/users.xml”</span>;
userIndexService.ServiceComplete += <span style="color:#0000ff;">new</span> HttpServiceCompleteEventHandler(userIndexService_ServiceComplete);
userIndexService.send();

<span style="color:#008000;">// create a new user</span>
userCreateService = <span style="color:#0000ff;">new</span> HTTPService();
userCreateService.Url = <span style="color:#006080;">“http://localhost:3000/users.xml”</span>;
userCreateService.Method = <span style="color:#006080;">“POST”</span>;
userCreateService.ServiceComplete += <span style="color:#0000ff;">new</span> HttpServiceCompleteEventHandler(userCreateService_ServiceComplete);

<span style="color:#008000;">// update a user, we will not be trapping the results</span>
userUpdateService = <span style="color:#0000ff;">new</span> HTTPService();
userUpdateService.Method = <span style="color:#006080;">“POST”</span>;

<span style="color:#008000;">// delete a user</span>
userDeleteService = <span style="color:#0000ff;">new</span> HTTPService();
userDeleteService.Method = <span style="color:#006080;">“POST”</span>;
}

<span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> _userList_SelectionChanged(<span style="color:#0000ff;">object</span> sender, SelectionChangedEventArgs e) {
controls.DataContext = userList.SelectedItem <span style="color:#0000ff;">as</span> User;
}

<span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> userIndexService_ServiceComplete(HttpServiceCompleteEventArgs e) {
<span style="color:#0000ff;">foreach</span> (User user <span style="color:#0000ff;">in</span> User.users_from_xml(e.Response))
userListItems.Add(user);
}
<span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> userCreateService_ServiceComplete(HttpServiceCompleteEventArgs e) {
userListItems.Add(User.user_from_xml(e.Response));
}

<span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> createButton_Click(<span style="color:#0000ff;">object</span> sender, RoutedEventArgs e) {
userCreateService.send(String.Format(<span style="color:#006080;">“{0}={1}&amp;{2}={3}”</span>, <span style="color:#006080;">“user[name]“</span>, userName.Text, <span style="color:#006080;">“user[address]“</span>, userAddress.Text));
}

<span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> updateButton_Click(<span style="color:#0000ff;">object</span> sender, RoutedEventArgs e) {
User _selectedUser = userList.SelectedItem <span style="color:#0000ff;">as</span> User;
userUpdateService.Url = <span style="color:#006080;">“http://localhost:3000/users/”</span> + _selectedUser.id.ToString() + <span style="color:#006080;">“.xml”</span>;
userUpdateService.send(String.Format(<span style="color:#006080;">“{0}={1}&amp;{2}={3}&amp;{4}={5}”</span>, <span style="color:#006080;">“user[name]“</span>, userName.Text, <span style="color:#006080;">“user[address]“</span>, userAddress.Text, <span style="color:#006080;">“_method”</span>, <span style="color:#006080;">“PUT”</span>));
userListItems[userList.SelectedIndex] = _selectedUser;
}

<span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> deleteButton_Click(<span style="color:#0000ff;">object</span> sender, RoutedEventArgs e) {
User _selectedUser = userList.SelectedItem <span style="color:#0000ff;">as</span> User;
userDeleteService.Url = <span style="color:#006080;">“http://localhost:3000/users/”</span> + _selectedUser.id.ToString() + <span style="color:#006080;">“.xml”</span>;
userDeleteService.send(String.Format(<span style="color:#006080;">“{0}={1}”</span>, <span style="color:#006080;">“_method”</span>, <span style="color:#006080;">“DELETE”</span>));
userListItems.Remove(_selectedUser);
}

}
}</pre>
</div>
<p>To understand the specific parameters to the “send()” method of the HTTPService class you will need a little bit of understanding of how REST is implemented in Rails and how parameters are passed to a url, which is out of scope of this blog post.</p>
<p>Change Page.xaml to:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">UserControl</span> <span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">=”TestFrontEnd.Page”</span>
<span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=”http://schemas.microsoft.com/client/2007″</span>
<span style="color:#ff0000;">xmlns <img class="wp-smiley" src="http://techblogging.wordpress.com/wp-includes/images/smilies/icon_mad.gif" alt="x" /> </span><span style="color:#0000ff;">=”http://schemas.microsoft.com/winfx/2006/xaml”</span>
<span style="color:#ff0000;">Width</span><span style="color:#0000ff;">=”400″</span> <span style="color:#ff0000;">Height</span><span style="color:#0000ff;">=”300″</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Grid</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”LayoutRoot”</span> <span style="color:#ff0000;">Background</span><span style="color:#0000ff;">=”White”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">StackPanel</span> <span style="color:#ff0000;">Orientation</span><span style="color:#0000ff;">=”Vertical”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ListBox</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userList”</span> <span style="color:#ff0000;">ItemsSource</span><span style="color:#0000ff;">=”{Binding}”</span> <span style="color:#ff0000;">DisplayMemberPath</span><span style="color:#0000ff;">=”name”</span> <span style="color:#ff0000;">SelectionChanged</span><span style="color:#0000ff;">=”_userList_SelectionChanged”</span> <span style="color:#ff0000;">Height</span><span style="color:#0000ff;">=”200″</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">StackPanel</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”controls”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=”{Binding name, Mode=Twoway}”</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userName”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBox</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=”{Binding address, Mode=Twoway}”</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”userAddress”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">StackPanel</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">StackPanel</span> <span style="color:#ff0000;">Orientation</span><span style="color:#0000ff;">=”Horizontal”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Button</span> <span style="color:#ff0000;">Content</span><span style="color:#0000ff;">=”Create”</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”createButton”</span> <span style="color:#ff0000;">Click</span><span style="color:#0000ff;">=”createButton_Click”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Button</span> <span style="color:#ff0000;">Content</span><span style="color:#0000ff;">=”Update”</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”updateButton”</span> <span style="color:#ff0000;">Click</span><span style="color:#0000ff;">=”updateButton_Click”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Button</span> <span style="color:#ff0000;">Content</span><span style="color:#0000ff;">=”Delete”</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”deleteButton”</span> <span style="color:#ff0000;">Click</span><span style="color:#0000ff;">=”deleteButton_Click”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">StackPanel</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">TextBlock</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=”trace”</span> <span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">StackPanel</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Grid</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">UserControl</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>This is how it looks like now:</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/image7.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/image-thumb7.png?w=481&#038;h=423&#038;h=423" border="0" alt="image" width="481" height="423" /></a></p>
<p>So this is full CRUD implementation using Silverlight as frontend.</p>
<p>This is not the most optimal way to implement CRUD it is very easy to understand. It also should be noted that I haven’t added error checking of any type in the code and there is a lot of code repetition. But I guess that could be improved upon further once the most simple scenario is implemented. My style of coding is “First make it work and then optimize it”, and as I have mentioned it before it is certainly not the most optimized way to code but it sure works <img class="wp-smiley" src="http://techblogging.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=")" /></p>
<p>One microsoft releases better databinding capabilities in controls and some simpler classes for HTTP based communication, this code would be much more simpler.</p>
<p>Full code for this aplication can be downloaded from:</p>
<li><a href="http://cid-49208a72e4eb818c.skydrive.live.com/self.aspx/world/code/test.rar">Rails code</a></li>
<li><a href="http://cid-49208a72e4eb818c.skydrive.live.com/self.aspx/world/code/TestFrontEnd2.rar">Silverlight code</a></li>
<div id="5ce5ff6c-9474-4531-909c-9f79bda9013e" class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">del.icio.us Tags: <a rel="tag" href="http://del.icio.us/popular/adobe">adobe</a>,<a rel="tag" href="http://del.icio.us/popular/C#">C#</a>,<a rel="tag" href="http://del.icio.us/popular/crud">crud</a>,<a rel="tag" href="http://del.icio.us/popular/flex">flex</a>,<a rel="tag" href="http://del.icio.us/popular/microsoft">microsoft</a>,<a rel="tag" href="http://del.icio.us/popular/rails">rails</a>,<a rel="tag" href="http://del.icio.us/popular/ruby%20on%20rails">ruby on rails</a>,<a rel="tag" href="http://del.icio.us/popular/silverlight">silverlight</a>,<a rel="tag" href="http://del.icio.us/popular/xaml">xaml</a></div>
</div>
</div>
<p class="postmetadata">This entry was posted on March 26, 2008 at 12:55 pm						and is filed under <a title="View all posts in C#" rel="category tag" href="http://wordpress.com/tag/c/">C#</a>,  <a title="View all posts in adobe" rel="category tag" href="http://wordpress.com/tag/adobe/">adobe</a>,  <a title="View all posts in crud" rel="category tag" href="http://wordpress.com/tag/crud/">crud</a>,  <a title="View all posts in flex" rel="category tag" href="http://wordpress.com/tag/flex/">flex</a>,  <a title="View all posts in microsoft" rel="category tag" href="http://wordpress.com/tag/microsoft/">microsoft</a>,  <a title="View all posts in mxml" rel="category tag" href="http://wordpress.com/tag/mxml/">mxml</a>,  <a title="View all posts in rails" rel="category tag" href="http://wordpress.com/tag/rails/">rails</a>,  <a title="View all posts in ruby" rel="category tag" href="http://wordpress.com/tag/ruby/">ruby</a>,  <a title="View all posts in ruby on rails" rel="category tag" href="http://wordpress.com/tag/ruby-on-rails/">ruby on rails</a>,  <a title="View all posts in silverlight" rel="category tag" href="http://wordpress.com/tag/silverlight/">silverlight</a>,  <a title="View all posts in xaml" rel="category tag" href="http://wordpress.com/tag/xaml/">xaml</a>. 						. 						You can follow any responses to this entry through the <a href="http://techblogging.wordpress.com/2008/03/26/using-silverlight-with-rubyonrails/feed/">RSS 2.0</a> feed.  						 													You can <a href="http://techblogging.wordpress.com/2008/03/26/using-silverlight-with-rubyonrails/#respond">leave a response</a>, or <a rel="trackback" href="http://techblogging.wordpress.com/2008/03/26/using-silverlight-with-rubyonrails/trackback/">trackback</a> from your own site.</p>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mkjeevika.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mkjeevika.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mkjeevika.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mkjeevika.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mkjeevika.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mkjeevika.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mkjeevika.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mkjeevika.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mkjeevika.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mkjeevika.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mkjeevika.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mkjeevika.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mkjeevika.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mkjeevika.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mkjeevika.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mkjeevika.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=6&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mkjeevika.wordpress.com/2008/04/17/silverlight-with-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f6ae9b692f1f10d52af05656fa66f8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeevika</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/vs-step1-thumb.png?w=609&#38;h=415" medium="image">
			<media:title type="html">vs_step1</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/vs-step2-thumb.png?w=439&#38;h=368" medium="image">
			<media:title type="html">vs_step2</media:title>
		</media:content>

		<media:content url="http://techblogging.wordpress.com/wp-includes/images/smilies/icon_mad.gif" medium="image">
			<media:title type="html">x</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/vs-step3-thumb.png?w=480&#38;h=416" medium="image">
			<media:title type="html">vs_step3</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/image-thumb6.png?w=481&#38;h=423" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://techblogging.wordpress.com/wp-includes/images/smilies/icon_mad.gif" medium="image">
			<media:title type="html">x</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/image-thumb7.png?w=481&#38;h=423" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://techblogging.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">)</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails 2.0 deprecations</title>
		<link>http://mkjeevika.wordpress.com/2008/04/17/rails-20-deprecations/</link>
		<comments>http://mkjeevika.wordpress.com/2008/04/17/rails-20-deprecations/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 07:57:50 +0000</pubDate>
		<dc:creator>Jeevika</dc:creator>
				<category><![CDATA[Rails 2.0]]></category>
		<category><![CDATA[Rails 2.0 deprecations]]></category>
		<category><![CDATA[rails2.0]]></category>

		<guid isPermaLink="false">http://mkjeevika.wordpress.com/?p=3</guid>
		<description><![CDATA[The Rails core team is cleaning up. That’s obviously a good thing, however it does leave us facing a kabillion deprecation warnings when running tests and whatnot. Unfortunately the official deprecations page appears to have been thrown together quickly after someone noticed that Rails 1.2 had been pushed out without anyone finishing the page that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=3&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <span class="searchword">Rails</span> core team is cleaning up. That’s obviously a good thing, however it does leave us facing a kabillion deprecation warnings when running tests and whatnot.</p>
<p>Unfortunately <a href="http://rubyonrails.org/deprecation">the official deprecations page</a> appears to have been thrown together quickly after someone noticed that <span class="searchword">Rails</span> 1.2 had been pushed out without anyone finishing the page that all deprecation warnings were referring to.</p>
<p>So what does a smart <span class="searchword">Rails</span> developer who wants to be ready for <span class="searchword">Rails</span> <span class="searchword">2.0</span> when that time comes around do? She reads on…</p>
<h2>end_form_tag is deprecated</h2>
<table border="0">
<tbody>
<tr>
<th>The old, deprecated way</th>
<th>The new, supported way</th>
</tr>
<tr>
<td>
<pre>&lt;%= start_form_tag %&gt;
  ...stuff...
&lt;%= end_form_tag %&gt;</pre>
</td>
<td>
<pre>&lt;% form_tag <span class="keyword">do</span> %&gt;
  ...stuff...
&lt;% <span class="keyword">end</span> %&gt;</pre>
</td>
</tr>
<tr>
<td>
<pre>&lt;%= form_remote_tag %&gt;
  ...stuff...
&lt;%= end_form_tag %&gt;</pre>
</td>
<td>
<pre>&lt;% form_remote_tag <span class="keyword">do</span> %&gt;
  ...stuff...
&lt;% <span class="keyword">end</span> %&gt;</pre>
</td>
</tr>
</tbody>
</table>
<h2>Object transactions are deprecated</h2>
<table border="0">
<tbody>
<tr>
<th>The old, deprecated way</th>
<th>The new, supported way</th>
</tr>
<tr>
<td>
<pre><span class="constant">Model</span>.transaction<span class="bracket">(</span>foo<span class="bracket">)</span> <span class="keyword">do</span>
  ...stuff...
<span class="keyword">end</span></pre>
</td>
<td>
<pre><span class="constant">Model</span>.transaction <span class="keyword">do</span>
  ...stuff...
<span class="keyword">end</span></pre>
</td>
</tr>
</tbody>
</table>
<h2>server_settings has been renamed smtp_settings</h2>
<table border="0">
<tbody>
<tr>
<th>The old, deprecated way</th>
<th>The new, supported way</th>
</tr>
<tr>
<td>
<pre><span class="constant">ActionMailer</span><span class="symbol">::Base.server_settings</span> = {
  <span class="symbol">:address  =&gt; 'my.smtp.srv</span>'
}</pre>
</td>
<td>
<pre><span class="constant">ActionMailer</span><span class="symbol">::Base.smtp_settings</span> = {
  <span class="symbol">:address  =&gt; 'my.smtp.srv</span>'
}</pre>
</td>
</tr>
</tbody>
</table>
<h2>start_form_tag is deprecated</h2>
<table border="0">
<tbody>
<tr>
<th>The old, deprecated way</th>
<th>The new, supported way</th>
</tr>
<tr>
<td>
<pre>&lt;%= start_form_tag %&gt;
  ...stuff...
&lt;%= end_form_tag %&gt;</pre>
</td>
<td>
<pre>&lt;% form_tag <span class="keyword">do</span> %&gt;
  ...stuff...
&lt;% <span class="keyword">end</span> %&gt;</pre>
</td>
</tr>
</tbody>
</table>
<h2>You called count([“field = ?”, value], nil)</h2>
<table border="0">
<tbody>
<tr>
<th>The old, deprecated way</th>
<th>The new, supported way</th>
</tr>
<tr>
<td>
<pre>model_or_association.count<span class="bracket">(</span>[<span class="string">'field = ?'</span>, value]<span class="bracket">)</span></pre>
</td>
<td>
<pre>model_or_association.count<span class="bracket">(</span><span class="symbol">:conditions =&gt; ['field = ?', value</span>]<span class="bracket">)</span></pre>
</td>
</tr>
</tbody>
</table>
<h2>You’ve called image_path with a source that doesn’t include an extension</h2>
<table border="0">
<tbody>
<tr>
<th>The old, deprecated way</th>
<th>The new, supported way</th>
</tr>
<tr>
<td>
<pre>&lt;%= image_tag <span class="string">'foo'</span> %&gt;</pre>
</td>
<td>
<pre>&lt;%= image_tag <span class="string">'foo.png'</span> %&gt;</pre>
</td>
</tr>
</tbody>
</table>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mkjeevika.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mkjeevika.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mkjeevika.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mkjeevika.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mkjeevika.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mkjeevika.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mkjeevika.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mkjeevika.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mkjeevika.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mkjeevika.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mkjeevika.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mkjeevika.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mkjeevika.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mkjeevika.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mkjeevika.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mkjeevika.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=3&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mkjeevika.wordpress.com/2008/04/17/rails-20-deprecations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f6ae9b692f1f10d52af05656fa66f8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeevika</media:title>
		</media:content>
	</item>
		<item>
		<title>Flex With ROR</title>
		<link>http://mkjeevika.wordpress.com/2008/04/17/flex-with-ror/</link>
		<comments>http://mkjeevika.wordpress.com/2008/04/17/flex-with-ror/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 07:55:14 +0000</pubDate>
		<dc:creator>Jeevika</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://mkjeevika.wordpress.com/?p=5</guid>
		<description><![CDATA[Using Flex with Ruby on Rails The steps needed to create the Rails application using Flex Creating a new Flex project: Open Flex builder and create a new Flex project. Leave all the options to default and click Finish. A blank project is now created for you. Add a List control to the default mxml [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=5&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="post-84" class="post">
<h2><a title="Permanent Link to Using Flex with Ruby on Rails" rel="bookmark" href="http://techblogging.wordpress.com/2008/03/26/using-flex-with-rubyonrails/">Using Flex with Ruby on Rails</a></h2>
<div class="entrytext">
<div class="snap_preview">
<p>The steps needed to create the Rails application using Flex</p>
<h5><span style="text-decoration:underline;">Creating a new Flex project:</span></h5>
<p>Open Flex builder and create a new Flex project.</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/image8.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/image-thumb8.png?w=517&#038;h=484&#038;h=484" border="0" alt="image" width="517" height="484" /></a></p>
<p>Leave all the options to default and click Finish. A blank project is now created for you.</p>
<p>Add a List control to the default mxml file. It should look like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;?</span><span style="color:#800000;">xml</span> <span style="color:#ff0000;">version</span><span style="color:#0000ff;">=”1.0″</span> <span style="color:#ff0000;">encoding</span><span style="color:#0000ff;">=”utf-8″</span>?<span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Application</span> <span style="color:#ff0000;">xmlns:mx</span><span style="color:#0000ff;">=”http://www.adobe.com/2006/mxml”</span> <span style="color:#ff0000;">layout</span><span style="color:#0000ff;">=”vertical”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:List</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userList”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”200″</span> <span style="color:#ff0000;">height</span><span style="color:#0000ff;">=”200″</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:Application</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>Now create a script tag inside the source and add a Bindable element to it:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">[Bindable]
<span style="color:#0000ff;">private</span> <span style="color:#0000ff;">var</span> users:XMLListCollection = <span style="color:#0000ff;">new</span> XMLListCollection();</pre>
</div>
<p>I am using an XMLListCollection because I can easily add/remove elements from it.</p>
<h5><span style="text-decoration:underline;">Now send request to the server and bind the result to the list box:</span></h5>
<p>First create a new HTTPService element:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">&lt;mx:HTTPService id=<span style="color:#006080;">“userIndexService”</span> resultFormat=<span style="color:#006080;">“e4x”</span> result=<span style="color:#006080;">“userIndexServiceResult(event)”</span> url=<span style="color:#006080;">“http://localhost:3000/users.xml”</span>/&gt;</pre>
</div>
<p>and handle its result:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">function</span> userIndexServiceResult(<span style="color:#0000ff;">event</span>:ResultEvent):<span style="color:#0000ff;">void</span>{
<span style="color:#0000ff;">for</span> each(<span style="color:#0000ff;">var</span> xml:XML <span style="color:#0000ff;">in</span> <span style="color:#0000ff;">event</span>.result.user <span style="color:#0000ff;">as</span> XMLList){
users.addItem(xml);
}
}</pre>
</div>
<p>To invoke this service we need to call its “send()” method with appropriate paramater, which in this case are none.</p>
<p>So the code now looks like:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;?</span><span style="color:#800000;">xml</span> <span style="color:#ff0000;">version</span><span style="color:#0000ff;">=”1.0″</span> <span style="color:#ff0000;">encoding</span><span style="color:#0000ff;">=”utf-8″</span>?<span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Application</span> <span style="color:#ff0000;">xmlns:mx</span><span style="color:#0000ff;">=”http://www.adobe.com/2006/mxml”</span> <span style="color:#ff0000;">layout</span><span style="color:#0000ff;">=”vertical”</span> <span style="color:#ff0000;">initialize</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Script</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;!</span>[CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.XMLListCollection;
[Bindable]
private var users:XMLListCollection = new XMLListCollection();

private function sendServiceRequest(event:Event):void{
userIndexService.send();
}
private function userIndexServiceResult(event:ResultEvent):void{
for each(var xml:XML in event.result.user as XMLList){
users.addItem(xml);
}
}
]]<span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:Script</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userIndexService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">result</span><span style="color:#0000ff;">=”userIndexServiceResult(event)”</span> <span style="color:#ff0000;">url</span><span style="color:#0000ff;">=”http://localhost:3000/users.xml”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:List</span> <span style="color:#ff0000;">dataProvider</span><span style="color:#0000ff;">=”{users}”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userList”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”200″</span> <span style="color:#ff0000;">height</span><span style="color:#0000ff;">=”200″</span> <span style="color:#ff0000;">labelField</span><span style="color:#0000ff;">=”name”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:Application</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>And the output looks like:</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/image9.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/image-thumb9.png?w=454&#038;h=411&#038;h=411" border="0" alt="image" width="454" height="411" /></a></p>
<p>Notice that we are sending the index request in the initialize method of the application.</p>
<p>Now to add controls which show the currently selected element. Its really easy. Just add the folowwing to the code and DataBinding will do the rest:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Label</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”Name”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”50″</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:TextInput</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”{userList.selectedItem.name}”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”150″</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userName”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Label</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”Address”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”50″</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:TextInput</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”{userList.selectedItem.address}”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”150″</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userAddress”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>Now it loooks like:</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/image10.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/image-thumb10.png?w=442&#038;h=442&#038;h=442" border="0" alt="image" width="442" height="442" /></a></p>
<h5><span style="text-decoration:underline;">Implementing the full CRUD:</span></h5>
<p>Now we need to add the other three HTTPServices.</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userIndexService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">result</span><span style="color:#0000ff;">=”userIndexServiceResult(event)”</span> <span style="color:#ff0000;">url</span><span style="color:#0000ff;">=”http://localhost:3000/users.xml”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userCreateService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">result</span><span style="color:#0000ff;">=”userCreateServiceResult(event)”</span> <span style="color:#ff0000;">method</span><span style="color:#0000ff;">=”POST”</span> <span style="color:#ff0000;">url</span><span style="color:#0000ff;">=”http://localhost:3000/users.xml”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userUpdateService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">method</span><span style="color:#0000ff;">=”POST”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userDeleteService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">method</span><span style="color:#0000ff;">=”POST”</span><span style="color:#0000ff;">/&gt;</span></pre>
</div>
<p>And their corresponding callbacks.</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">function</span> userCreateServiceResult(<span style="color:#0000ff;">event</span>:ResultEvent):<span style="color:#0000ff;">void</span>{
users.addItem(<span style="color:#0000ff;">event</span>.result <span style="color:#0000ff;">as</span> XML);
}</pre>
</div>
<p>Some controls to invoke these services:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Button</span> <span style="color:#ff0000;">label</span><span style="color:#0000ff;">=”Create”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”createUser”</span> <span style="color:#ff0000;">click</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Button</span> <span style="color:#ff0000;">label</span><span style="color:#0000ff;">=”Update”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”updateUser”</span> <span style="color:#ff0000;">click</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Button</span> <span style="color:#ff0000;">label</span><span style="color:#0000ff;">=”Delete”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”deleteUser”</span> <span style="color:#ff0000;">click</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>And their event handlers (just one in this case):</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">function</span> sendServiceRequest(<span style="color:#0000ff;">event</span>:Event):<span style="color:#0000ff;">void</span>{
<span style="color:#0000ff;">if</span>(<span style="color:#0000ff;">event</span>.target.id == <span style="color:#006080;">‘createUser’</span>){
userCreateService.send({<span style="color:#006080;">‘user[name]‘</span>: userName.text, <span style="color:#006080;">‘user[address]‘</span>: userAddress.text});
}<span style="color:#0000ff;">else</span> <span style="color:#0000ff;">if</span>(<span style="color:#0000ff;">event</span>.target.id == <span style="color:#006080;">‘updateUser’</span>){
userUpdateService.url = <span style="color:#006080;">‘http://localhost:3000/users/’</span>+ userList.selectedItem.id +<span style="color:#006080;">‘.xml’</span>;
userUpdateService.send({<span style="color:#006080;">‘user[name]‘</span>: userName.text, <span style="color:#006080;">‘user[address]‘</span>: userAddress.text, _method: <span style="color:#006080;">‘put’</span>});
users[userList.selectedIndex].name = userName.text;
users[userList.selectedIndex].address = userAddress.text;
}<span style="color:#0000ff;">else</span> <span style="color:#0000ff;">if</span>(<span style="color:#0000ff;">event</span>.target.id == <span style="color:#006080;">‘deleteUser’</span>){
userDeleteService.url = <span style="color:#006080;">‘http://localhost:3000/users/’</span>+ userList.selectedItem.id +<span style="color:#006080;">‘.xml’</span>;
userDeleteService.send({_method: <span style="color:#006080;">‘delete’</span>});
users.removeItemAt(userList.selectedIndex);
}<span style="color:#0000ff;">else</span>{
userIndexService.send();
}
}</pre>
</div>
<p>Little bit of  knowledge of how REST is implemented in Rails is required to understand the parameters to the     “send()” method of HTTPService class is required, which is out of scope of this blog post.</p>
<p>The TestFrontEnd.mxml should now have the folowwing code:</p>
<div>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;?</span><span style="color:#800000;">xml</span> <span style="color:#ff0000;">version</span><span style="color:#0000ff;">=”1.0″</span> <span style="color:#ff0000;">encoding</span><span style="color:#0000ff;">=”utf-8″</span>?<span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Application</span> <span style="color:#ff0000;">xmlns:mx</span><span style="color:#0000ff;">=”http://www.adobe.com/2006/mxml”</span> <span style="color:#ff0000;">layout</span><span style="color:#0000ff;">=”vertical”</span> <span style="color:#ff0000;">initialize</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Script</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;!</span>[CDATA[
import mx.collections.XMLListCollection;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
[Bindable]
private var users:XMLListCollection = new XMLListCollection();

private function sendServiceRequest(event:Event):void{
if(event.target.id == ‘createUser’){
userCreateService.send({’user[name]‘: userName.text, ‘user[address]‘: userAddress.text});
}else if(event.target.id == ‘updateUser’){
userUpdateService.url = ‘http://localhost:3000/users/’+ userList.selectedItem.id +’.xml’;
userUpdateService.send({’user[name]‘: userName.text, ‘user[address]‘: userAddress.text, _method: ‘put’});
users[userList.selectedIndex].name = userName.text;
users[userList.selectedIndex].address = userAddress.text;
}else if(event.target.id == ‘deleteUser’){
userDeleteService.url = ‘http://localhost:3000/users/’+ userList.selectedItem.id +’.xml’;
userDeleteService.send({_method: ‘delete’});
users.removeItemAt(userList.selectedIndex);
}else{
userIndexService.send();
}
}

private function userIndexServiceResult(event:ResultEvent):void{
for each(var xml:XML in event.result.user as XMLList){
users.addItem(xml);
}
}
private function userCreateServiceResult(event:ResultEvent):void{
users.addItem(event.result as XML);
}
]]<span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:Script</span><span style="color:#0000ff;">&gt;</span>

<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userIndexService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">result</span><span style="color:#0000ff;">=”userIndexServiceResult(event)”</span> <span style="color:#ff0000;">url</span><span style="color:#0000ff;">=”http://localhost:3000/users.xml”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userCreateService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">result</span><span style="color:#0000ff;">=”userCreateServiceResult(event)”</span> <span style="color:#ff0000;">method</span><span style="color:#0000ff;">=”POST”</span> <span style="color:#ff0000;">url</span><span style="color:#0000ff;">=”http://localhost:3000/users.xml”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userUpdateService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">method</span><span style="color:#0000ff;">=”POST”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HTTPService</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userDeleteService”</span> <span style="color:#ff0000;">resultFormat</span><span style="color:#0000ff;">=”e4x”</span> <span style="color:#ff0000;">method</span><span style="color:#0000ff;">=”POST”</span><span style="color:#0000ff;">/&gt;</span>

<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:List</span> <span style="color:#ff0000;">dataProvider</span><span style="color:#0000ff;">=”{users}”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userList”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”200″</span> <span style="color:#ff0000;">height</span><span style="color:#0000ff;">=”200″</span> <span style="color:#ff0000;">labelField</span><span style="color:#0000ff;">=”name”</span><span style="color:#0000ff;">/&gt;</span>

<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Label</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”Name”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”50″</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:TextInput</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”{userList.selectedItem.name}”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”150″</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userName”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Label</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”Address”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”50″</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:TextInput</span> <span style="color:#ff0000;">text</span><span style="color:#0000ff;">=”{userList.selectedItem.address}”</span> <span style="color:#ff0000;">width</span><span style="color:#0000ff;">=”150″</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”userAddress”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Button</span> <span style="color:#ff0000;">label</span><span style="color:#0000ff;">=”Create”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”createUser”</span> <span style="color:#ff0000;">click</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Button</span> <span style="color:#ff0000;">label</span><span style="color:#0000ff;">=”Update”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”updateUser”</span> <span style="color:#ff0000;">click</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">mx:Button</span> <span style="color:#ff0000;">label</span><span style="color:#0000ff;">=”Delete”</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=”deleteUser”</span> <span style="color:#ff0000;">click</span><span style="color:#0000ff;">=”sendServiceRequest(event)”</span><span style="color:#0000ff;">/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:HBox</span><span style="color:#0000ff;">&gt;</span>

<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">mx:Application</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>This is the end result:</p>
<p><a href="http://techblogging.files.wordpress.com/2008/03/image11.png"><img style="border-width:0;" src="http://techblogging.files.wordpress.com/2008/03/image-thumb11.png?w=441&#038;h=483&#038;h=483" border="0" alt="image" width="441" height="483" /></a></p>
<p>As I mentioned in my last blog post it is not the best way to make this application as there is no error handling. But I think this is the simplest way to make this application.</p>
<p>You also might have noticed Flex requires a lot less lines of code as compared to Silverlight. But that is also dependent on my coding approach.</p>
<p>Full code for this application can be downloaded from:</p>
<ul>
<li><a href="http://cid-49208a72e4eb818c.skydrive.live.com/self.aspx/world/code/test.rar">Rails code</a></li>
<li><a href="http://cid-49208a72e4eb818c.skydrive.live.com/self.aspx/world/code/TestFrontEndFlex.rar">Flex code</a></li>
</ul>
<div id="9cde01ca-f4d1-4e36-94d6-1cd81702baf9" class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">del.icio.us Tags: <a rel="tag" href="http://del.icio.us/popular/adobe">adobe</a>,<a rel="tag" href="http://del.icio.us/popular/flex">flex</a>,<a rel="tag" href="http://del.icio.us/popular/mxmx">mxmx</a>,<a rel="tag" href="http://del.icio.us/popular/rails">rails</a>,<a rel="tag" href="http://del.icio.us/popular/ruby">ruby</a>,<a rel="tag" href="http://del.icio.us/popular/ruby%20on%20rails">ruby on rails</a>,<a rel="tag" href="http://del.icio.us/popular/silverlight">silverlight</a>,<a rel="tag" href="http://del.icio.us/popular/xaml">xaml</a></div>
</div>
</div>
<p class="postmetadata">This entry was posted on March 26, 2008 at 7:08 pm						and is filed under <a title="View all posts in adobe" rel="category tag" href="http://wordpress.com/tag/adobe/">adobe</a>,  <a title="View all posts in flex" rel="category tag" href="http://wordpress.com/tag/flex/">flex</a>,  <a title="View all posts in mxml" rel="category tag" href="http://wordpress.com/tag/mxml/">mxml</a>,  <a title="View all posts in rails" rel="category tag" href="http://wordpress.com/tag/rails/">rails</a>,  <a title="View all posts in ruby" rel="category tag" href="http://wordpress.com/tag/ruby/">ruby</a>,  <a title="View all posts in ruby on rails" rel="category tag" href="http://wordpress.com/tag/ruby-on-rails/">ruby on rails</a>,  <a title="View all posts in silverlight" rel="category tag" href="http://wordpress.com/tag/silverlight/">silverlight</a>,  <a title="View all posts in xaml" rel="category tag" href="http://wordpress.com/tag/xaml/">xaml</a>. 						. 						You can follow any responses to this entry through the <a href="http://techblogging.wordpress.com/2008/03/26/using-flex-with-rubyonrails/feed/">RSS 2.0</a> feed.  						 													You can <a href="http://techblogging.wordpress.com/2008/03/26/using-flex-with-rubyonrails/#respond">leave a response</a>, or <a rel="trackback" href="http://techblogging.wordpress.com/2008/03/26/using-flex-with-rubyonrails/trackback/">trackback</a> from your own site.</p>
<p class="postmetadata">Regards</p>
<p class="postmetadata">Jeevika</p>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mkjeevika.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mkjeevika.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mkjeevika.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mkjeevika.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mkjeevika.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mkjeevika.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mkjeevika.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mkjeevika.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mkjeevika.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mkjeevika.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mkjeevika.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mkjeevika.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mkjeevika.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mkjeevika.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mkjeevika.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mkjeevika.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=5&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mkjeevika.wordpress.com/2008/04/17/flex-with-ror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f6ae9b692f1f10d52af05656fa66f8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeevika</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/image-thumb8.png?w=517&#38;h=484" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/image-thumb9.png?w=454&#38;h=411" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/image-thumb10.png?w=442&#38;h=442" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://techblogging.files.wordpress.com/2008/03/image-thumb11.png?w=441&#38;h=483" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails 2.0</title>
		<link>http://mkjeevika.wordpress.com/2007/12/05/hello-world/</link>
		<comments>http://mkjeevika.wordpress.com/2007/12/05/hello-world/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 06:56:22 +0000</pubDate>
		<dc:creator>Jeevika</dc:creator>
				<category><![CDATA[Rails 2.0]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[&#160; Rails 2.0 Behold, behold, Rails 2.0 is almost here. But before we can slap on the final stamp, we’re going to pass through a couple of trial release phases. The first is this preview release, which allows you to sample the goodies in their almost finished state. We might change a few things or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=1&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="post">&nbsp;</p>
<h2>Rails 2.0</h2>
<p class="auth"> Behold, behold, Rails 2.0 is almost here. But before we can slap on the final stamp, we’re going to pass through a couple of trial release phases. The first is this preview release, which allows you to sample the goodies in their almost finished state.</p>
<p>We might change a few things or add something else, but by and large, this is how Rails 2.0 is going to look and feel. After this release have had a chance to be tried out, we’re going to move to a release candidate or two (or three, depending on how many we need). Then, the final release.</p>
<p>Before the release of 2.0, we’re also going to be putting out 1.2.4, which will include a variety of bug fixes and the last deprecation warnings to get you ready for upgrading an existing application to 2.0 standards.</p>
<p>Enough about process. Let me tell you a little bit about what’s new in Rails 2.0:</p>
<p><strong>Action Pack: Resources</strong></p>
<p>This is where the bulk of the action for 2.0 has gone. We’ve got a slew of improvements to the RESTful lifestyle. First, we’ve dropped the semicolon for custom methods instead of the regular slash. So <code>/people/1;edit</code> is now <code>/people/1/edit</code>. We’ve also added the namespace feature to routing resources that makes it really easy to confine things like admin interfaces:</p>
<pre><code>map.namespace(:admin) do |admin|

  admin.resources :products,

    :collection =&gt; { :inventory =&gt; :get },

    :member     =&gt; { :duplicate =&gt; :post },

    :has_many   =&gt; [ :tags, :images, :variants ]

end</code></pre>
<p>Which will give you named routes like inventory_admin_products_url and admin_product_tags_url. To keep track of this named routes proliferation, we’ve added the “rake routes” task, which will list all the named routes created by routes.rb.</p>
<p>We’ve also instigated a new convention that all resource-based controllers will be plural by default. This allows a single resource to be mapped in multiple contexts and still refer to the same controller. Example:</p>
<pre><code>

  # /avatars/45 =&gt; AvatarsController#show

  map.resources :avatars</code>  # /people/5/avatar =&gt; AvatarsController#show

  map.resources :people, :has_one =&gt; :avatar</pre>
<p><strong>Action Pack: Multiview</strong></p>
<p>Alongside the improvements for resources come improvements for multiview. We already have #respond_to, but we’ve taken it a step further and made it dig into the templates. We’ve separated the format of the template from its rendering engine. So show.rhtml now becomes show.html.erb, which is the template that’ll be rendered by default for a show action that has declared format.html in its respond_to. And you can now have something like show.csv.erb, which targets text/csv, but also uses the default <span class="caps">ERB</span> renderer.</p>
<p>So the new format for templates is action.format.renderer. A few examples:</p>
<ul>
<li>show.erb: same show template for all formats</li>
<li>index.atom.builder: uses the Builder format, previously known as rxml, to render an index action for the application/atom+xml mime type</li>
<li>edit.iphone.haml: uses the custom <span class="caps">HAML</span> template engine (not included by default) to render an edit action for the custom Mime::IPHONE format</li>
</ul>
<p>Speaking of the iPhone, we’ve made it easier to declare “fake” types that are only used for internal routing. Like when you want a special <span class="caps">HTML</span> interface just for an iPhone. All it takes is something like this:</p>
<pre><code>

  # should go in config/initializers/mime_types.rb

  Mime.register_alias "text/html", :iphone</code>  class ApplicationController &lt; ActionController::Base

    before_filter :adjust_format_for_iphone

private

      def adjust_format_for_iphone

        if request.env["HTTP_USER_AGENT"] &amp;&amp; request.env["HTTP_USER_AGENT"][/(iPhone|iPod)/]

          request.format = :iphone

        end

      end

  end

class PostsController &lt; ApplicationController

    def index

      respond_to do |format|

        format.html   # renders index.html.erb

        format.iphone # renders index.iphone.erb

      end

    end

  end</pre>
<p>You’re encouraged to declare your own mime-type aliases in the config/initializers/mime_types.rb file. This file is included by default in all new applications.</p>
<p><strong>Action Pack: Record identification</strong></p>
<p>Piggy-backing off the new drive for resources are a number of simplifications for controller and view methods that deal with URLs. We’ve added a number of conventions for turning model classes into resource routes on the fly. Examples:</p>
<pre><code>

  # person is a Person object, which by convention will

  # be mapped to person_url for lookup

  redirect_to(person)

  link_to(person.name, person)

  form_for(person)

</code></pre>
<p><strong>Action Pack: <span class="caps">HTTP</span> Loving</strong></p>
<p>As you might have gathered, Action Pack in Rails 2.0 is all about getting closer with <span class="caps">HTTP</span> and all its glory. Resources, multiple representations, but there’s more. We’ve added a new module to work with <span class="caps">HTTP</span> Basic Authentication, which turns out to be a great way to do <span class="caps">API</span> authentication over <span class="caps">SSL</span>. It’s terribly simple to use. Here’s an example (there are more in ActionController::HttpAuthentication):</p>
<pre><code>

  class PostsController &lt; ApplicationController

    USER_NAME, PASSWORD = "dhh", "secret" </code>    before_filter :authenticate, :except =&gt; [ :index ]

def index

      render :text =&gt; "Everyone can see me!"

    end

def edit

      render :text =&gt; "I'm only accessible if you know the password"

    end

private

      def authenticate

        authenticate_or_request_with_http_basic do |user_name, password|

          user_name == USER_NAME &amp;&amp; password == PASSWORD

        end

      end

  end</pre>
<p>We’ve also made it much easier to structure your JavaScript and stylesheet files in logical units without getting clobbered by the <span class="caps">HTTP</span> overhead of requesting a bazillion files. Using javascript_include_tag(:all, :cache =&gt; true) will turn public/javascripts/.js into a single public/javascripts/all.js file in production, while still keeping the files separate in development, so you can work iteratively without clearing the cache.</p>
<p>Along the same lines, we’ve added the option to cheat browsers who don’t feel like pipelining requests on their own. If you set ActionController::Base.asset_host = “assets%d.example.com”, we’ll automatically distribute your asset calls (like image_tag) to asset1 through asset4. That allows the browser to open many more connections at a time and increases the perceived speed of your application.</p>
<p><strong>Action Pack: Security</strong></p>
<p>Making it even easier to create secure applications out of the box is always a pleasure and with Rails 2.0 we’re doing it from a number of fronts. Most importantly, we now ship we a built-in mechanism for dealing with <span class="caps">CRSF</span> attacks. By including a special token in all forms and Ajax requests, you can guard from having requests made from outside of your application. All this is turned on by default in new Rails 2.0 applications and you can very easily turn it on in your existing applications using ActionController::Base.protect_from_forgery (see ActionController::RequestForgeryProtection for more).</p>
<p>We’ve also made it easier to deal with <span class="caps">XSS</span> attacks while still allowing users to embed <span class="caps">HTML</span> in your pages. The old TextHelper#sanitize method has gone from a black list (very hard to keep secure) approach to a white list approach. If you’re already using sanitize, you’ll automatically be granted better protection. You can tweak the tags that are allowed by default with sanitize as well. See TextHelper#sanitize for details.</p>
<p>Finally, we’ve added support for <a href="http://msdn2.microsoft.com/en-us/library/ms533046.aspx"><span class="caps">HTTP</span> only cookies</a>. They are not yet supported by all browsers, but you can use them where they are.</p>
<p><strong>Action Pack: Exception handling</strong></p>
<p>Lots of common exceptions would do better to be rescued at a shared level rather than per action. This has always been possible by overwriting rescue_action_in_public, but then you had to roll out your own case statement and call super. Bah. So now we have a class level macro called rescue_from, which you can use to declaratively point certain exceptions to a given action. Example:</p>
<pre><code>

  class PostsController &lt; ApplicationController

    rescue_from User::NotAuthorized, :with =&gt; :deny_access</code>    protected

      def deny_access

        ...

      end

  end</pre>
<p><strong>Action Pack: Miscellaneous</strong></p>
<p>Also of note is AtomFeedHelper, which makes it even simpler to create Atom feeds using an enhanced Builder syntax. Simple example:</p>
<pre><code>

  # index.atom.builder:

  atom_feed do |feed|

    feed.title("My great blog!")

    feed.updated((@posts.first.created_at))</code>    for post in @posts

      feed.entry(post) do |entry|

        entry.title(post.title)

        entry.content(post.body, :type =&gt; 'html')

entry.author do |author|

          author.name("DHH")

        end

      end

    end

  end</pre>
<p>We’ve made a number of performance improvements, so asset tag calls are now much cheaper and we’re caching simple named routes, making them much faster too.</p>
<p>Finally, we’ve kicked out in_place_editor and autocomplete_for into plugins that live on the official Rails <span class="caps">SVN</span>.</p>
<p><strong>Active Record: Performance</strong></p>
<p>Active Record has seen a gazillion fixes and small tweaks, but it’s somewhat light on big new features. Something new that we have added, though, is a very simple Query Cache, which will recognize similar <span class="caps">SQL</span> calls from within the same request and return the cached result. This is especially nice for N+1 situations that might be hard to handle with :include or other mechanisms. We’ve also drastically improved the performance of fixtures, which makes most test suites based on normal fixture use be 50-100% faster.</p>
<p><strong>Active Record: Sexy migrations</strong></p>
<p>There’s a new alternative format for declaring migrations in a slightly more efficient format. Before you’d write:</p>
<pre><code>create_table :people do |t|

  t.column, "account_id",  :integer

  t.column, "first_name",  :string, :null =&gt; false

  t.column, "last_name",   :string, :null =&gt; false

  t.column, "description", :text

  t.column, "created_at",  :datetime

  t.column, "updated_at",  :datetime

end</code></pre>
<p>Now you can write:</p>
<pre><code>create_table :people do |t|

  t.integer :account_id

  t.string  :first_name, :last_name, :null =&gt; false

  t.text    :description

  t.timestamps

end</code></pre>
<p><strong>Active Record: <span class="caps">XML</span> in, <span class="caps">JSON</span> out</strong></p>
<p>Active Record has supported serialization to <span class="caps">XML</span> for a while. In 2.0 we’ve added deserialization too, so you can say Person.new.from_xml(“<br />
David“) and get what you’d expect. We’ve also added serialization to <span class="caps">JSON</span>, which supports the same syntax as <span class="caps">XML</span> serialization (including nested associations). Just do person.to_json and you’re ready to roll.</p>
<p><strong>Active Record: Shedding some weight</strong></p>
<p>To make Active Record a little leaner and meaner, we’ve removed the acts_as_XYZ features and put them into individual plugins on the Rails <span class="caps">SVN</span> repository. So say you’re using acts_as_list, you just need to do ./script/plugin install acts_as_list and everything will move along like nothing ever happened.</p>
<p>A little more drastic, we’ve also pushed all the commercial database adapters into their own gems. So Rails now only ships with adapters for MySQL, SQLite, and PostgreSQL. These are the databases that we have easy and willing access to test on. But that doesn’t mean the commercial databases are left out in the cold. Rather, they’ve now been set free to have an independent release schedule from the main Rails distribution. And that’s probably a good thing as the commercial databases tend to require a lot more exceptions and hoop jumping on a regular basis to work well.</p>
<p>The commercial database adapters now live in gems that all follow the same naming convention: activerecord-XYZ-adapter. So if you gem install activerecord-oracle-adapter, you’ll instantly have Oracle available as an adapter choice in all the Rails applications on that machine. You won’t have to change a single line in your applications to take use of it.</p>
<p>That also means it’ll be easier for new database adapters to gain traction in the Rails world. As long as you package your adapter according to the published conventions, users just have to install the gem and they’re ready to roll.</p>
<p><strong>Active Record: with_scope with a dash of syntactic vinegar</strong></p>
<p>ActiveRecord::Base.with_scope has gone protected to discourage people from misusing it in controllers (especially in filters). Instead, it’s now encouraged that you only use it within the model itself. That’s what it was designed for and where it logically remains a good fit. But of course, this is all about encouraging and discouraging. If you’ve weighed the pros and the cons and still want to use with_scope outside of the model, you can always call it through .send(:with_scope).</p>
<p><strong>ActionWebService out, ActiveResource in</strong></p>
<p>It’ll probably come as no surprise that Rails has picked a side in the <span class="caps">SOAP</span> vs <span class="caps">REST</span> debate. Unless you absolutely have to use <span class="caps">SOAP</span> for integration purposes, we strongly discourage you from doing so. As a naturally extension of that, we’ve pulled ActionWebService from the default bundle. It’s only a gem install actionwebservice away, but it sends an important message none the less.</p>
<p>At the same time, we’ve pulled the new ActiveResource framework out of beta and into the default bundle. ActiveResource is like ActiveRecord, but for resources. It follows a similar <span class="caps">API</span> and is configured to Just Work with Rails applications using the resource-driven approach. For example, a vanilla scaffold will be accessible by ActiveResource.</p>
<p><strong>ActiveSupport</strong></p>
<p>There’s not all that much new in ActiveSupport. We’ve a host of new methods like Array#rand for getting a random element from an array, Hash#except to filter down a hash from undesired keys and lots of extensions for Date. We also made testing a little nicer with assert_difference. Short of that, it’s pretty much just fixes and tweaks.</p>
<p><strong>Action Mailer</strong></p>
<p>This is a very modest update for Action Mailer. Besides a handful of bug fixes, we’ve added the option to register alternative template engines and assert_emails to the testing suite, which works like this:</p>
<ol>
<li>Assert number of emails delivered within a block: assert_emails 1 do   post :signup, :name =&gt; ‘Jonathan’ end</li>
</ol>
<p><strong>Rails: The debugger is back</strong></p>
<p>To tie it all together, we have a stream of improvements for Rails in general. My favorite amongst these is the return of the breakpoint in form of the debugger. It’s a real debugger too, not just an <span class="caps">IRB</span> dump. You can step back and forth, list your current position, and much more. It’s all coming from the gracious note of the ruby-debug gem. So you’ll have to install that for the new debugger to work.</p>
<p>To use the debugger, you just install the gem, put “debugger” somewhere in your application, and then start the server with—debugger or -u. When the code executes the debugger command, you’ll have it available straight in the terminal running the server. No need for script/breakpointer or anything else. You can use the debugger in your tests too.</p>
<p><strong>Rails: Clean up your environment</strong></p>
<p>Before Rails 2.0, config/environment.rb files every where would be clogged with all sorts of one-off configuration details. Now you can gather those elements in self-contained files and put them under config/initializers and they’ll automatically be loaded. New Rails 2.0 applications ship with two examples in form of inflections.rb (for your own pluralization rules) and mime_types.rb (for your own mime types). This should ensure that you need to keep nothing but the default in config/environment.rb.</p>
<p><strong>Rails: Easier plugin order</strong></p>
<p>Now that we’ve yanked out a fair amount of stuff from Rails and into plugins, you might well have other plugins that depend on this functionality. This can require that you load, say, acts_as_list before your own acts_as_extra_cool_list plugin in order for the latter to extend the former.</p>
<p>Before, this required that you named <em>all</em> your plugins in config.plugins. Major hassle when all you wanted to say was “I only care about acts_as_list being loaded before everything else”. Now you can do exactly that with config.plugins = [ :acts_as_list, :all ].</p>
<p><strong>And hundreds upon hundreds of other improvements</strong></p>
<p>What I’ve talked about above is but a tiny sliver of the full 2.0 package. We’ve got literally hundreds of bug fixes, tweaks, and feature enhancements crammed into Rails 2.0. All this coming off the work of tons of eager contributors working tirelessly to improve the framework in small, but important ways.</p>
<p>I encourage you to scourger the CHANGELOGs and learn more about all that changed.</p>
<p><strong>So how do I upgrade?</strong></p>
<p>If you want to move your application to Rails 2.0, you should first move it to Rails 1.2.3. That’ll include deprecation warnings for most everything we yanked out in 2.0. So if your application runs fine on 1.2.3 with no deprecation warnings, there’s a good chance that it’ll run straight up on 2.0. Of course, if you’re using, say, pagination, you’ll need to install the classic_pagination plugin. If you’re using Oracle, you’ll need to install the activerecord-oracle-adapter gem. And so on and so forth for all the extractions.</p>
<p>To install the preview release through gems, do:</p>
<pre><code>gem install rails --source http://gems.rubyonrails.org</code></pre>
<p>To try it from an <span class="caps">SVN</span> tag, use:</p>
<pre><code>rake rails:freeze:edge TAG=rel_2-0-0_PR</code></pre>
<p>We’ll also be putting out Rails 1.2.4 shortly which will include a few more deprecations to warn you in time for 2.0.</p>
<p>In any case, as I explained in the beginning, this is a preview release. Use it to get a feel for 2.0. See where your currently application might need tweaks. And try creating a new application from scratch to see the new defaults. In a few weeks we’ll get on with the release candidates.</p>
<p>Thanks to everyone who’ve been involved with the development of Rails 2.0. We’ve been working on this for more than six months and it’s great finally to be able to share it with a larger audience. Enjoy!</p>
<p class="meta">            Posted in <a href="http://weblog.rubyonrails.org/releases">Releases</a>        <strong>|</strong> <a href="http://weblog.rubyonrails.org/2007/9/30/rails-2-0-0-preview-release">135 comments</a></p>
<p class="comments">     <a title="comments" name="comments" id="comments"></a></p>
<h4 class="blueblk">Comments</h4>
<p class="postmetadata alt"><a href="http://weblog.rubyonrails.org/2007/9/30/rails-2-0-0-preview-release#respond">Leave a response</a></p>
<ol class="commentlist">
<li>         <a title="comment-17126" name="comment-17126"></a> <cite><strong>DHH</strong></cite> on 30 Sep 23:24:<br />
If you know of any blogging done on Rails 2.0 features, please comment with links in this thread.</li>
<li>         <a title="comment-17127" name="comment-17127"></a> <cite><strong>Joe Ruby</strong></cite> on 30 Sep 23:59:<br />
“So /people/1;edit is now /people/1/edit”I missed <acronym title="emo">TFM</acronym> explaining why the newish semi-colon for custom methods is being reverted back. Briefly searching the forums I found:“Doesn’t work with page caching, safari has bugs with authentication with urls with semi colons in it. Various libraries (like mongrel) mistakenly consider ; to be part of the query string.”</li>
<li>         <a title="comment-17128" name="comment-17128"></a> <cite><strong>J. Pablo Fernandez</strong></cite> on 01 Oct 00:03:<br />
When is the final stable version expected to be released?</li>
<li>         <a title="comment-17129" name="comment-17129"></a> <cite><strong>donnacha</strong></cite> on 01 Oct 00:03:<br />
So … when will the updated edition of “Agile Web Development with Rails” be hitting the shelves?</li>
<li>         <a title="comment-17130" name="comment-17130"></a> <cite><strong>Nate</strong></cite> on 01 Oct 00:06:<br />
Great stuff. The query cache rocks. If anyone wants to use it on their Rails 1.2.x apps without upgrading to edge I pulled it into a <a href="http://code.inklingmarkets.com/journal/query-cache-plugin-for-rails-12x.html">plugin</a></li>
<li>         <a title="comment-17131" name="comment-17131"></a> <cite><strong>Andy</strong></cite> on 01 Oct 00:19:<br />
Thanks for all the hard work!  Can’t wait to try it out.</li>
<li>         <a title="comment-17132" name="comment-17132"></a> <cite><strong>DHH</strong></cite> on 01 Oct 00:48:<br />
Pablo, the first two paragraphs of this announcement is as good as it’ll get for a target right now.donnacha, the changes in 2.0 are in some ways less overall disruptive than the changes in 1.2. So I wouldn’t expect (or think we need) an immediate update to that book.</li>
<li>         <a title="comment-17133" name="comment-17133"></a> <cite><strong>Julik</strong></cite> on 01 Oct 01:28:<br />
Ironically, it’s the first releas of Rails where I feel like parting ways with the framework. I’m curious what will come next though, so I will stay some more.</li>
<li>         <a title="comment-17134" name="comment-17134"></a> <cite><strong>Tom</strong></cite> on 01 Oct 01:40:<br />
Quick note: I just pulled rel_2-0-0_PR. It still seems to include actionwebservice and doesn’t fetch activeresource.</li>
<li>         <a title="comment-17135" name="comment-17135"></a> <cite><strong>Tom</strong></cite> on 01 Oct 01:45:<br />
Ok, ignore previous comment: I had to run the rails:freeze:edge twice. The first time, it still used settings from version 1.2. Tom</li>
<li>         <a title="comment-17136" name="comment-17136"></a> <cite><strong>Luke Melia</strong></cite> on 01 Oct 02:21:<br />
Looks great.Is there a decent way to get slashes instead of semi-colons for RESTful routes in 1.2.x for those of us about to launch apps?</li>
<li>         <a title="comment-17137" name="comment-17137"></a> <cite><strong>Jeremy Kemper</strong></cite> on 01 Oct 02:50:<br />
Luke, the forthcoming 1.2.4 release will introduce the new routing style and deprecate the old to ease the transition to 2.0.</li>
<li>         <a title="comment-17138" name="comment-17138"></a> <cite><strong>MilesZS</strong></cite> on 01 Oct 02:53:<br />
Mr Melia:I have been using this with success: http://push.cx/2007/rails-semicolons-out-slashes-inHope that helps.</li>
<li>         <a title="comment-17139" name="comment-17139"></a> <cite><strong>pyodor</strong></cite> on 01 Oct 03:44:<br />
can’t wait to try this <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>         <a title="comment-17140" name="comment-17140"></a> <cite><strong>Chu Yeow</strong></cite> on 01 Oct 03:55:<br />
Dugg this <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  -&gt; http://digg.com/software/Rails_2_0_Preview_Release_availableMy favorite is the <span class="caps">JSON</span> changes, especially that <a href="http://dev.rubyonrails.org/changeset/7697">only valid <span class="caps">JSON</span> is emitted</a> now (all object keys are quoted now), though it’s not mentioned in this blog post.</li>
<li>         <a title="comment-17147" name="comment-17147"></a> <cite><strong>Manu</strong></cite> on 01 Oct 05:26:<br />
where can I get the changelog?</li>
<li>         <a title="comment-17148" name="comment-17148"></a> <cite><strong>rick</strong></cite> on 01 Oct 05:52:<br />
You can get the changelogs for the individual components: <a href="http://svn.rubyonrails.org/rails/trunk/activerecord/CHANGELOG">activerecord</a>, <a href="http://svn.rubyonrails.org/rails/trunk/actionpack/CHANGELOG">actionpack</a>, etc.</li>
<li>         <a title="comment-17150" name="comment-17150"></a> <cite><strong>Kristof</strong></cite> on 01 Oct 06:14:<br />
<span class="caps">DHH</span>, I’d be also interested in the book update (like many others I think).Years ago I got the first book but Rails improving that fast I lost my track completely in months following up the changes. Since that, I haven’t touched rails for over a year now. I’d like to give it a second spin but buying into the 1.2 book, I’m scared to make the same story happening again..Also, I’d love to read about more advanced topics like cluster-deployment, caching, capistrano, etc. Do you still suggest me buying into the 1.2-compatible version of the book? Honestly, a few months wait would be worth for me learning the most uptodate material. Thanks!</li>
<li>         <a title="comment-17151" name="comment-17151"></a> <cite><strong>Phil Thompson</strong></cite> on 01 Oct 07:04:<br />
Just wanted to thank everyone for working so hard on the new release. I’ve been trying out ActiveResource and it’s so lightweight, so simple to use. Along with all the other enhancements this is really shaping up to be a great release and certainly fit to be called 2.0. Thanks again.</li>
<li>         <a title="comment-17152" name="comment-17152"></a> <cite><strong>Chetan Mittal</strong></cite> on 01 Oct 07:35:<br />
<span class="caps">WOW</span> !!! The ActiveResource pick, Migrations and ActionPack changes are awesome. Thanks for the hard-work.</li>
<li>         <a title="comment-17153" name="comment-17153"></a> <cite><strong>http://www.botvector.net</strong></cite> on 01 Oct 08:00:<br />
That is really good news!</li>
<li>         <a title="comment-17155" name="comment-17155"></a> <cite><strong>Spif</strong></cite> on 01 Oct 08:38:<br />
<blockquote><p>Action Pack: Resources 	More way to use routes in creative ways. <span class="caps">AKA</span> more ways to slow your Rails App down.</p></blockquote>
<blockquote><p>Action Pack: Record identification 	More useless ways to use slow, slow routes.</p></blockquote>
<p>What happened to “Rails 2 was going to be faster and smaller than 1.x, with significantly more code moved outside the core.” While plenty of code has moved out of the core, the core itself is larger and slower than before. Perhaps after 2.0 there will be time to do some much-needed cleanup.</li>
<li>         <a title="comment-17156" name="comment-17156"></a> <cite><strong>Lisa Seelye</strong></cite> on 01 Oct 09:02:<br />
So where are the tests for the split off adapter gems?http://svn.rubyonrails.org/rails/adapters/ seems devoid of tests which kind of sucks cos I want to submit a patch!</li>
<li>         <a title="comment-17157" name="comment-17157"></a> <cite><strong>Garth</strong></cite> on 01 Oct 09:08:<br />
The thing I like the most about this release is the break out of pieces into gems and plug-ins. Rails was starting to get bloated and much of the functionality offered by the framework wasn’t getting used in my projects. Great job on getting this release out so far.</li>
<li>         <a title="comment-17158" name="comment-17158"></a> <cite><strong>Pratik</strong></cite> on 01 Oct 09:38:<br />
I had blogged about some simple steps to enable <span class="caps">CSRF</span> protection for your existing apps – http://m.onkey.org/2007/9/28/csrf-protection-for-your-existing-rails-application</li>
<li>         <a title="comment-17159" name="comment-17159"></a> <cite><strong>Peter</strong></cite> on 01 Oct 09:38:<br />
Is there some documentation on why exactly with_scope is discouraged for filters?The <a href="http://www.caboo.se/articles/2006/2/22/nested-with_scope">scoped_access</a> plugin uses with_scope extensively for just this purpose.  I suppose you are saying this is bad practice.  <em>why</em>?</li>
<li>         <a title="comment-17160" name="comment-17160"></a> <cite><strong>Skyblaze</strong></cite> on 01 Oct 10:15:<br />
I think that a signifiacnt update to the <span class="caps">AWDVR</span> book is a must. And as other said it could be updated also with new things such as capistrano 2 and some advanced concepts and examples..</li>
<li>         <a title="comment-17161" name="comment-17161"></a> <cite><strong>Heiko</strong></cite> on 01 Oct 10:43:<br />
Great news. Some notes about the security paragraph, click my name.</li>
<li>         <a title="comment-17162" name="comment-17162"></a> <cite><strong>Toño</strong></cite> on 01 Oct 10:52:<br />
Great work guys!</li>
<li>         <a title="comment-17164" name="comment-17164"></a> <cite><strong>Pratik</strong></cite> on 01 Oct 11:29:<br />
Peter : Check out post/comments at <a href="http://ryandaigle.com/articles/2006/07/20/a-rails-feature-you-should-be-using-with_scope">this post</a></li>
<li>         <a title="comment-17165" name="comment-17165"></a> <cite><strong>Sam</strong></cite> on 01 Oct 11:35:<br />
You guys rock. I especially like the <span class="caps">CSRF</span> protection you put in.</li>
<li>         <a title="comment-17166" name="comment-17166"></a> <cite><strong>Matt</strong></cite> on 01 Oct 11:55:<br />
Blogged my initial reaction, installing the 2.0PR gem now to give it a go and will post results of that.http://didcoe.id.au/archives/rails-20-the-release-is-near</li>
<li>         <a title="comment-17167" name="comment-17167"></a> <cite><strong>peanut</strong></cite> on 01 Oct 12:48:<br />
So, I think it’s a great work. Rails becomes more cleaner, intelligent and faster (I think).</li>
<li>         <a title="comment-17168" name="comment-17168"></a> <cite><strong>Thibaud Guillaume-Gentil</strong></cite> on 01 Oct 12:48:<br />
If you want to rename (svn move here) all your files with *.rhtml to *html.erb in one command line try this:for f in $(find . -name *.rhtml) ; do g=$(dirname $f)/$(basename $f .rhtml).html.erb ; svn mv $f $g ; doneEnjoy!</li>
<li>         <a title="comment-17170" name="comment-17170"></a> <cite><strong>nap</strong></cite> on 01 Oct 13:11:<br />
Great work everyone. This is excellent. And thanks for nixing the semi in restful routes <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</li>
<li>         <a title="comment-17171" name="comment-17171"></a> <cite><strong>Ryan</strong></cite> on 01 Oct 13:41:<br />
<blockquote><p>Years ago I got the first book but Rails improving that fast I lost my track completely in months following up the changes. Since that, I haven’t touched rails for over a year now. I’d like to give it a second spin but buying into the 1.2 book, I’m scared to make the same story happening again..</p></blockquote>
<p>I agree. I have held off buying <cite>Agile 2.0</cite> due to the changes in Edge. While the 1.1 to 1.2 transition included lots of new, better ways to do things and added to the framework, 2.0 seems to make much more fundamental changes in the day-to-day tasks. In other words, I’ve had to rewrite more code for this transition, though that may just be me.</p>
<p>Otherwise, great work! Rails continues to impress me more and more!</li>
<li>         <a title="comment-17172" name="comment-17172"></a> <cite><strong>DHH</strong></cite> on 01 Oct 14:16:<br />
spif, funny that both the examples you choose to highlight are ones that are actually much faster in Rails 2.0 than they were in Rails 1.2.3.Resources uses named routes and so does the new record identification. And named routes now do a lot of clever optimizations to be way faster than the regular url_for approach.So please get your facts straight before screaming murder.</li>
<li>         <a title="comment-17175" name="comment-17175"></a> <cite><strong>Spif</strong></cite> on 01 Oct 14:47:<br />
<span class="caps">DHH</span>, sorry if my comment was a bit crude.It <strong>is</strong> great to see Rails maturing, simplifying and conforming to more small common practices (like the resources dropping semicolons from custom methods). Overall great effort, yet lacking <span class="caps">IMO</span> in one key feat: core performance.Let me rephrase my critique to something more constructive. While I do think the new features are useful and do speed things up, my personal feeling is that the core performance issues have not been addressed, yet bypassed by things like clever optimizations.So even though we use and admire the massive work in Rails, still hoping for renewed focus on performance.No offense meant and keep up the great work!</li>
<li>         <a title="comment-17177" name="comment-17177"></a> <cite><strong>Scott</strong></cite> on 01 Oct 14:53:<br />
If I am to understand the multi-view, .rjs files would become .js.erb? If this is the case it doesn’t currently render the file automatically as if it were named &lt;action&gt;.rjs.</li>
<li>         <a title="comment-17178" name="comment-17178"></a> <cite><strong>Chris</strong></cite> on 01 Oct 14:57:<br />
<blockquote><p>it’ll be easier for new database adapters to gain traction in the Rails world. As long as you package your adapter according to the published conventions, users just have to install the gem and they’re ready to roll.</p></blockquote>
<p>I worry though that this will lead to 30 different MySQL adapters, all claiming to be better than the rest. Will there be an official line of adapters or some kind of official adapter validation process?</li>
<li>         <a title="comment-17179" name="comment-17179"></a> <cite><strong>DHH</strong></cite> on 01 Oct 14:57:<br />
Spif, this release has actually seen more attention paid to performance than any release since 1.0. We profiled Rails extensively and made a number of optimizations based on that (like caching asset tag file calls, the new BufferedLogger etc).We also benchmarked Rails against leaner alternatives, like Merb, and were much surprised to see that the difference wasn’t at all as big as expected (especially once you started doing real-world things, like rendering an <span class="caps">ERB</span> template instead of just doing a text-based “hello world”). And that things like alias_method_chain, which has gotten a lot of flak for supposedly being the end of the world slow, really didn’t make much of a difference.But I agree that we should continue to improve the performance of Rails. Just that this release is probably the wrong one to complain that we <span class="caps">NEVER</span> pay any attention to that <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>         <a title="comment-17180" name="comment-17180"></a> <cite><strong>Chris</strong></cite> on 01 Oct 15:02:<br />
PS: Oops! I didn’t mean to leave only a concern – Thanks for all the hard work. Can’t wait to try some of the new things. The new sexy migration syntax (that really should be the offical name) will save precious keystrokes and make a lot of sense!</li>
<li>         <a title="comment-17181" name="comment-17181"></a> <cite><strong>DHH</strong></cite> on 01 Oct 15:13:<br />
Chris, there’ll only be 1 official Rails adapter per database. But it’ll be easier for people to create new adapters for databases we don’t already cover.</li>
<li>         <a title="comment-17182" name="comment-17182"></a> <cite><strong>Torsten</strong></cite> on 01 Oct 16:03:<br />
Congratulations to the Rails team for continuing to shape such a great product for the next steps. I look forward to using all the cool features – only this speed of innovation will help to make Rails the basis for interesting web applications.Keep on the good work.</li>
<li>         <a title="comment-17184" name="comment-17184"></a> <cite><strong>Dan Croak</strong></cite> on 01 Oct 16:12:<br />
Congrats to <span class="caps">DHH</span>, Rails Core, and all the contributors to Rails 2.0! Looking forward to getting my hands on it.When y’all did your profiling, did you use ruby-prof? Is that the recommended approach to profiling Rails apps? Would there be any advantage to adding a hypothetical script/profile that works with ruby-prof in the same manner that script/console interacts with irb and your Rails app?</li>
<li>         <a title="comment-17186" name="comment-17186"></a> <cite><strong>Roller8</strong></cite> on 01 Oct 16:27:<br />
I know I’m excited to implement this version! Any performance improvements are definitely high on my wish list also, but I’m still enjoying the development performance and appreciate all the great work of the Rails team!</li>
<li>         <a title="comment-17187" name="comment-17187"></a> <cite><strong>DHH</strong></cite> on 01 Oct 16:36:<br />
Dan Croak, yes we used ruby-prof. And you point about a script that wraps that is good. We’ve been working with a prototype of that for a while. We’ll put it in the bundle shortly.</li>
<li>         <a title="comment-17188" name="comment-17188"></a> <cite><strong>Sam Granieri</strong></cite> on 01 Oct 16:43:<br />
Thanks for getting 2.0 out in gem form in a preview release. I’ve been experimenting with thishttp://railstips.org/2007/5/31/even-edgier-than-edge-railsfor a while.</li>
<li>         <a title="comment-17189" name="comment-17189"></a> <cite><strong>Shane</strong></cite> on 01 Oct 17:07:<br />
Congrats…http://everydayblog.net/2007/10/01/ror-20/</li>
<li>         <a title="comment-17190" name="comment-17190"></a> <cite><strong>ctran</strong></cite> on 01 Oct 17:12:<br />
Just a minor correction on one of the examples, it’s Mime::Type.register_alias instead of Mime.register_alias.</li>
<li>         <a title="comment-17191" name="comment-17191"></a> <cite><strong>JTH</strong></cite> on 01 Oct 17:40:<br />
Just curious, does this have anything to do with the upcoming release of Tiger? i.e. is there a push to get 2.0 included in 10.5?</li>
<li>         <a title="comment-17192" name="comment-17192"></a> <cite><strong>Jan</strong></cite> on 01 Oct 17:51:<br />
Doinggem install rails—source http://gems.rubyonrails.orgthenrake rails:freeze:edge <span class="caps">TAG</span>=rel_2-0-0_PRgives meCannot find gem for Rails ~&gt;2.0.0gem query—remote—source http://gems.rubyonrails.org/ lists 1.2.3.7707 as the latest rails version. Am I doing something wrong?</li>
<li>         <a title="comment-17195" name="comment-17195"></a> <cite><strong>JTH</strong></cite> on 01 Oct 18:22:<br />
Leopard, I say. Leopard.</li>
<li>         <a title="comment-17197" name="comment-17197"></a> <cite><strong>AR</strong></cite> on 01 Oct 19:24:<br />
I’m having the same problem as Jan.  Installing the latest gem gives me 1.2.3.7707.  Any body have any idea what’s up?</li>
<li>         <a title="comment-17198" name="comment-17198"></a> <cite><strong>Jim Lindley</strong></cite> on 01 Oct 19:29:<br />
1.2.3.7707 is the same as 2.0 RC.Gems can only have version numbers, and this is the only way to get a 2.0 release out without calling it 2.0.0, which it isn’t.The 7707 part corresponds to the latest changeset, 7702 was the release tagged 2.0 RC, so you’re all set.</li>
<li>         <a title="comment-17199" name="comment-17199"></a> <cite><strong>jack dempsey</strong></cite> on 01 Oct 20:03:<br />
just a tip to those mentioning things like “Ok, ignore previous comment: I had to run the rails:freeze:edge twice. The first time, it still used settings from version 1.2. Tom”Remember, when you run that, its using the current rails code on your computer to pull down updates. Once you have that update version of rails, you can then run the command again to get all the updates IT knows about.Make sense? (I got used to doing this two time thing when first playing with ActiveResource when it hit edge).<span class="caps">BTW</span>, much thanks to the core team for all the work!</li>
<li>         <a title="comment-17200" name="comment-17200"></a> <cite><strong>jeem</strong></cite> on 01 Oct 21:13:<br />
In ActiveResource, as of rel_2-0-0_PR, “MyRestDude.find :all” still raises an error. “undefined method `collect!’ for #&lt;hash:0x3650c98&gt;”. See http://dev.rubyonrails.org/ticket/8798.Maybe find(:all) isn’t important to many Rest consumers, but it seems like a big bug to leave in 2.0.</li>
<li>         <a title="comment-17202" name="comment-17202"></a> <cite><strong>Glenn Rempe</strong></cite> on 01 Oct 21:55:<br />
Great job on Rails 2.0! Looking forward to putting it to use.Regarding getting your existing 1.2.3 application view files in line with the new naming standard for Rails 2.0.I found this script to be much more complete in the task of renaming all of your view files to be rails 2.0 compliant (e.g. <strong>.rhtml =&gt; *.html.erb, etc.). It handles a number of different file types and won’t incorrectly rename files under non app/views/</strong> dirs when run carelessly like the less comprehensive script provided above which happily renamed all of my rails and plugins files too.I didn’t write it (someone named Bret did). I am just linking to it as it did the trick very well for me. <span class="caps">YMMV</span>.Copy it to the file lib/tasks/views.rake and run ‘rake views:rename’(Oh, and modify it to use something other than <span class="caps">SVN</span> if you use Git like I do.) We shouldn’t be making assumptions about what version control system people are using in our scripts <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Script is here: http://pastie.caboo.se/84585.txtGlenn</li>
<li>         <a title="comment-17203" name="comment-17203"></a> <cite><strong>Felipe Giotto</strong></cite> on 01 Oct 21:59:<br />
Great post! Now I finally found out most of the benefits and features from Rails 2.0 in one single place!Felipe Luiz C. Giotto www.inovare.net</li>
<li>         <a title="comment-17205" name="comment-17205"></a> <cite><strong>Sergio O</strong></cite> on 01 Oct 22:31:<br />
Great to hear the news for 2.0 ! So would 2.0 be included in <span class="caps">OS X</span>?Looking forward to it !</li>
<li>         <a title="comment-17206" name="comment-17206"></a> <cite><strong>dan chak</strong></cite> on 01 Oct 22:34:<br />
From what I’ve read, the ActiveRecord query cache is only active from the start of an action’s execution to the end. So it sounds like it’s a band-aid for bad code that makes the same request over and over within a single action. (Why would anyone do that?)I’d rather see real database-level bind variables implemented in ActiveRecord (as opposed to performing the binding in Ruby). Then even well written code will get a performance boost. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Any chance we’ll see that in 2.1?</li>
<li>         <a title="comment-17208" name="comment-17208"></a> <cite><strong>Giorgio Clavelli</strong></cite> on 01 Oct 23:33:<br />
&#8230;we’re going to move to a release candidate or two (or three, depending on how many we need). Then, the final release.Firstly, thanks for this amazing framework. I’m relatively new to it, but I really enjoying the whole approach to web app development it promote. I’ve just one question, when do you think the final release may be available?Thanks</li>
<li>         <a title="comment-17209" name="comment-17209"></a> <cite><strong>Brian Doll</strong></cite> on 01 Oct 23:48:<br />
Any word on support for foreign keys in ActiveRecord? With a very common plugin available(http://www.redhillonrails.org/#foreign_key_migrations), I was hoping to see it rolled into core in v2.</li>
<li>         <a title="comment-17210" name="comment-17210"></a> <cite><strong>AkitaOnRails</strong></cite> on 02 Oct 00:01:<br />
Hey, great release. I was running Mephisto on Rails 1.2.3 and I decided to test 2.0PR. Turns out that I had to do very few adaptations on Mephisto and a couple of plugins and I already cap deployed my blog. It is online, production mode, running under 2.0PR. And so far it feels smooth as ever.Great release, congratulations!</li>
<li>         <a title="comment-17211" name="comment-17211"></a> <cite><strong>Mike Bailey</strong></cite> on 02 Oct 01:44:<br />
Congratulations on the release and thanks for the excellent summary.</li>
<li>         <a title="comment-17212" name="comment-17212"></a> <cite><strong>carlity</strong></cite> on 02 Oct 02:37:<br />
Obviously rails 2.0 won’t be included in Leopard, <span class="caps">OSX  10</span>.5 is coming out in a couple of weeks.</li>
<li>         <a title="comment-17213" name="comment-17213"></a> <cite><strong>Gary Castillo G</strong></cite> on 02 Oct 05:06:<br />
Thanks for all the hard work.Will we have composite primary keys on AR some day?Best regards.</li>
<li>         <a title="comment-17214" name="comment-17214"></a> <cite><strong>WildPalms</strong></cite> on 02 Oct 05:39:<br />
<span class="caps">JTH</span>, I think you mean Leopard. Tiger = 10.4, while Leopard = 10.5.</li>
<li>         <a title="comment-17215" name="comment-17215"></a> <cite><strong>deman</strong></cite> on 02 Oct 07:55:<br />
rails 2.0 preview = rails 1.2.3.7707??</li>
<li>         <a title="comment-17216" name="comment-17216"></a> <cite><strong>cengiz</strong></cite> on 02 Oct 09:02:<br />
I am very happy. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>         <a title="comment-17217" name="comment-17217"></a> <cite><strong>Anthony Green</strong></cite> on 02 Oct 10:22:<br />
The change to with_scope might break its usage in association declarations.I’ve been using the technique documented by Josh Susserhttp://blog.hasmanythrough.com/2006/08/19/magic-join-model-creationto magically create join models.Now I’m getting a protected method error in my tests.</li>
<li>         <a title="comment-17219" name="comment-17219"></a> <cite><strong>Aquiles</strong></cite> on 02 Oct 12:51:<br />
Any way to have Rails 2.0 and 1.2.3 on same machine???</li>
<li>         <a title="comment-17220" name="comment-17220"></a> <cite><strong>Paul Pagel</strong></cite> on 02 Oct 14:29:<br />
Aquiles, yes you can either have rails in your /vendor/plugins dir or install the gems as localgems to the project.</li>
<li>         <a title="comment-17229" name="comment-17229"></a> <cite><strong>nicolash</strong></cite> on 02 Oct 20:37:<br />
a label-helper is included but sadly not used in scaffold. Tiny thing but I never understood why it was not included before. Same goes for fieldset (with legend)</li>
<li>         <a title="comment-17230" name="comment-17230"></a> <cite><strong>billd</strong></cite> on 02 Oct 20:51:<br />
I haven’t read much about scaling.  Was there anything that addressed multi-threading or multiple databases?<span class="caps">DHH</span>: I’ve been reading Ryan’s blog which has some good details about Edge Rails changes. http://ryandaigle.com/Thank you developers! Can’t wait to check it out.</li>
<li>         <a title="comment-17231" name="comment-17231"></a> <cite><strong>polypus</strong></cite> on 02 Oct 23:58:<br />
i’m getting an error when i try to boot up script/server both with the gem and the freeze:edge versions.`const_missing’: uninitialized constant <span class="caps">CGI</span>::Session::CookieStoreanybody else get that?</li>
<li>         <a title="comment-17233" name="comment-17233"></a> <cite><strong>Rob</strong></cite> on 03 Oct 02:27:<br />
When will Rails finally get documentation without being forced to buy a $20 book?</li>
<li>         <a title="comment-17236" name="comment-17236"></a> <cite><strong>Carl</strong></cite> on 03 Oct 06:56:<br />
polypus: No, but this is what I get when running mongrel on my server when I try to run some of the web applications with a freezed 2.0 preview rails:vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:478:in `const_missing’: uninitialized constant ActionController::Caching::Sweeper::Reloadable (NameError)</li>
<li>         <a title="comment-17238" name="comment-17238"></a> <cite><strong>polypus</strong></cite> on 03 Oct 12:09:<br />
carl, weird, looks similar. you should post your problem up on my thread at rubyforum. i posted yesterday but have no responses yet. strength in numbers <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> http://www.railsforum.com/viewtopic.php?id=11608</li>
<li>         <a title="comment-17241" name="comment-17241"></a> <cite><strong>Dan Croak</strong></cite> on 03 Oct 14:38:<br />
<span class="caps">DHH</span> et al.,Are there any changes or innovations in testing?RSpec seems to be gaining momentum (although I haven’t used it). There’s plenty of support for Mocha and Flexmock. I know people are extending Test::Unit with methods like asserts_sends_email and should_be_restful.What are the opinions of Rails 2.0 on advancing great testing practices by Rails developers?</li>
<li>         <a title="comment-17242" name="comment-17242"></a> <cite><strong>spyros</strong></cite> on 03 Oct 16:47:<br />
First Thanx to the CoreTeam and congratulations for another great release.About sexy migrations… http://errtheblog.com/post/2381 features a plugin with the same title which makes things even sexier (!)by turningt.integer :account_idintoforeign_key :accountnice!</li>
<li>         <a title="comment-17243" name="comment-17243"></a> <cite><strong>DHH</strong></cite> on 03 Oct 17:36:<br />
Rob, if you don’t like what’s currently available for free (API docs, wikis, blog posts) and you don’t want to pay what’s available commercially (books, screencasts), then you have all the power in the world to come up with an alternative and give it away for free. Go for it!Dan, there’s a handful of new assertions, like assert_email and assert_difference_of. There’s also much faster fixtures. And you don’t have to explicitly declare them any more. I think those are some nice steps forward.And it’s really easy to add your own sugar on top. Whether you want to install mocha or rspec. I don’t think those things necessarily belongs in core.</li>
<li>         <a title="comment-17247" name="comment-17247"></a> <cite><strong>Diego</strong></cite> on 04 Oct 04:27:<br />
Rails 2.x should be more faster with Ruby 2.0 aka <span class="caps">YARV</span> right?</li>
<li>         <a title="comment-17248" name="comment-17248"></a> <cite><strong>Ted</strong></cite> on 04 Oct 04:52:<br />
David—Are you guys interested in taking ActiveResource the <span class="caps">RDF</span> route? I’m about finished with an acts_as_rdf plugin that gives ActiveResource objects a to_rdf method. Once that’s done it wouldn’t be too hard to make a from_rdf (except that to_rdf only requires the Builder for <span class="caps">RDFXML</span>, but from_rdf would want to take into account parsing any one of a number of <span class="caps">RDF</span> formats..)</li>
<li>         <a title="comment-17249" name="comment-17249"></a> <cite><strong>blj</strong></cite> on 04 Oct 09:04:<br />
Currently I use a very simple hack to keep the plugin dependency load order.I just name the folders like migration:00-money-1.7.1 01-google4r-checkoutworks and simple to change.</li>
<li>         <a title="comment-17254" name="comment-17254"></a> <cite><strong>DHH</strong></cite> on 04 Oct 16:44:<br />
Ted, I think that would probably be a plugin. But sounds cool. Do put it out there.</li>
<li>         <a title="comment-17255" name="comment-17255"></a> <cite><strong>Donnie</strong></cite> on 04 Oct 17:02:<br />
I know a definitive answer is not plausible, but will Rails 2.0 run on Ruby 2.0? Has there been any sort of testing in this direction?</li>
<li>         <a title="comment-17257" name="comment-17257"></a> <cite><strong>DHH</strong></cite> on 04 Oct 21:26:<br />
Donnie, Jeremy has done a good amount of work for 1.9 compatibility. But it really doesn’t matter. As soon as Ruby 2.0 is getting ready for release, we’ll make sure that there’s a Rails version that runs it.</li>
<li>         <a title="comment-17258" name="comment-17258"></a> <cite><strong>Alex Egg</strong></cite> on 04 Oct 23:50:<br />
Proper <span class="caps">JSON</span> encoding by default!</li>
<li>         <a title="comment-17268" name="comment-17268"></a> <cite><strong>versionboy_ms@yahoo.com</strong></cite> on 05 Oct 07:36:<br />
hellosend me computer booksthanking you</li>
<li>         <a title="comment-17271" name="comment-17271"></a> <cite><strong>Arjun</strong></cite> on 05 Oct 09:06:<br />
Hi David, have been yours for quite some time. So first congrats to u,core team and others u helped. I liked the migration thing. Made it much simpler. Also that is Rails is going the <span class="caps">REST</span> way.</li>
<li>         <a title="comment-17284" name="comment-17284"></a> <cite><strong>Dipesh</strong></cite> on 06 Oct 08:21:<br />
Hey! is resource_scaffold missing from Rails 2.0 or is there is alternative?</li>
<li>         <a title="comment-17297" name="comment-17297"></a> <cite><strong>Bala Paranj</strong></cite> on 07 Oct 07:47:<br />
Here is notes on how I used RESTful authentication plugin with Rails 2.0 preview release:http://bparanj.blogspot.com/2007/10/restful-authentication-with-rails-20.html</li>
<li>         <a title="comment-17300" name="comment-17300"></a> <cite><strong>Mike Bailey</strong></cite> on 07 Oct 16:10:<br />
Dipesh, scaffold_resource is now scaffold.</li>
<li>         <a title="comment-17302" name="comment-17302"></a> <cite><strong>Balls Itchy</strong></cite> on 07 Oct 19:29:<br />
Very cool, core team!</li>
<li>         <a title="comment-17313" name="comment-17313"></a> <cite><strong>Adz</strong></cite> on 08 Oct 23:49:<br />
Dipesh: Seems as though ‘scaffold’ does what ‘resource_scaffold’ used to….  I guess it’s now the (only) default.</li>
<li>         <a title="comment-17315" name="comment-17315"></a> <cite><strong>~SupaSharp~</strong></cite> on 09 Oct 12:40:<br />
I love <span class="caps">RUBY</span>!</li>
<li>         <a title="comment-17317" name="comment-17317"></a> <cite><strong>mr_roboto</strong></cite> on 09 Oct 16:48:<br />
any word on cookie based sessions? been hearing about these in edge rails and becoming the new default. is this making it in the 2.0 release?</li>
<li>         <a title="comment-17327" name="comment-17327"></a> <cite><strong>Andrew</strong></cite> on 10 Oct 14:55:<br />
Anybody else getting an error when they try and upgrade to the 2.0 PR using gems ? Anyway, great release guys. Keep up the good work.I am getting the following error: &gt; gem install rails—source http://gems.rubyonrails.org Install required dependency activesupport? [Yn] Y Install required dependency builder? [Yn] Y <span class="caps">ERROR</span>:  While executing gem … (Gem::GemNotFoundException)     Could not find builder (~&gt; 2.1.2) in the repository</li>
<li>         <a title="comment-17328" name="comment-17328"></a> <cite><strong>Andrew</strong></cite> on 10 Oct 16:06:<br />
For some reason I need to install the builder gem separately before installing the 2.0 PR gem.</li>
<li>         <a title="comment-17329" name="comment-17329"></a> <cite><strong>Sven</strong></cite> on 11 Oct 00:48:<br />
I’ve updated my gems to 1.2.4.7794, but I’m having trouble getting certain plugins to pass testing. In particular, with acts_as_attachment and acts_as_paranoid I’m encountering gem activation issues:</li>
<li>         <a title="comment-17330" name="comment-17330"></a> <cite><strong>Sven</strong></cite> on 11 Oct 00:54:<br />
(that’ll teach me to hit return)&#8230;activation issues like this: rubygems.rb:246:in `activate’: can’t activate rails (= 1.2.4), already activated rails-1.2.4.7794] (Gem::Exception)I’ve tried with and without rails in the vendor directory, and I’ve tried messing with <span class="caps">RAILS</span>_GEM_VERSION in environment.rb to no avail.</li>
<li>         <a title="comment-17346" name="comment-17346"></a> <cite><strong>Alex Wayne</strong></cite> on 12 Oct 21:55:<br />
Just beautiful.  Praise be the breakpoint support again!</li>
<li>         <a title="comment-17351" name="comment-17351"></a> <cite><strong>Sebastian Holmqvist</strong></cite> on 13 Oct 10:52:<br />
For all of us that have either been out of the bubble for a while or are completely new to some of the terminology used around here, an idea would be to define all official abbreviations on a single page and when using them in various contexts linking to that page.Other than that I can’t wait ‘til Rails 2.0 is final and burying myself under a ton of coding <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>         <a title="comment-17352" name="comment-17352"></a> <cite><strong>Bill Gates</strong></cite> on 13 Oct 13:43:<br />
Wow. I’m gonna definitely try it out.</li>
<li>         <a title="comment-17358" name="comment-17358"></a> <cite><strong>Mike</strong></cite> on 13 Oct 19:06:<br />
I’m having continuous problems while trying to install edge rails: Bulk updating Gem source index for: http://gems.rubyonrails.org Install required dependency activesupport? [Yn] <span class="caps">ERROR</span>:  While executing gem … (Gem::GemNotFoundException)     Could not find activesupport (= 1.4.3.7843) in the repository</p>
<pre><code>gem install rails --source http://gems.rubyonrails.org</code></pre>
<p>Any idea what’s wrong?</li>
<li>         <a title="comment-17361" name="comment-17361"></a> <cite><strong>Marc</strong></cite> on 14 Oct 03:14:<br />
Mike -Delete your source_cache file.  That usually fixes it.  See:http://www.ruby-forum.com/topic/71069</li>
<li>         <a title="comment-17363" name="comment-17363"></a> <cite><strong>gissmoh</strong></cite> on 14 Oct 07:22:<br />
Did not do the trick for me! I still get the same error:bullet:/tmp/rubygems-0.9.4 bullet$ sudo gem update Updating installed gems… Attempting remote update of activeresource Install required dependency activesupport? [Yn] <span class="caps">ERROR</span>: While executing gem … (Gem::GemNotFoundException) Could not find activesupport (= 1.4.3.7843) in any repository bullet:/tmp/rubygems-0.9.4 bullet$ sudo gem install rails—source http://gems.rubyonrails.org—include-dependencies <span class="caps">ERROR</span>: While executing gem … (Gem::GemNotFoundException) Could not find activesupport (= 1.4.3.7843) in any repository bullet:/tmp/rubygems-0.9.4 bullet$ sudo gem update Updating installed gems… Attempting remote update of activeresource Install required dependency activesupport? [Yn] <span class="caps">ERROR</span>: While executing gem … (Gem::GemNotFoundException) Could not find activesupport (= 1.4.3.7843) in any repository bullet:/tmp/rubygems-0.9.4 bullet$ sudo gem install rails—source http://gems.rubyonrails.org—include-dependencies <span class="caps">ERROR</span>:  While executing gem … (Gem::GemNotFoundException)     Could not find activesupport (= 1.4.3.7843) in any repository</li>
<li>         <a title="comment-17364" name="comment-17364"></a> <cite><strong>Piku</strong></cite> on 14 Oct 10:52:<br />
I have the same problem as gissmoh and Mike: “Could not find activesupport (= 1.4.3.7843) in any repository”</li>
<li>         <a title="comment-17365" name="comment-17365"></a> <cite><strong>iGL</strong></cite> on 14 Oct 11:58:<br />
The actual gem that gets installed via</p>
<blockquote>
<blockquote>
<blockquote><p>gem install activesupport—source http://gems.rubyonrails.org</p></blockquote>
</blockquote>
</blockquote>
<p>is 1.4.4.7843</p>
<p>However, even after that, the installation of rails 2.0.0-pr fails.</p>
<p>Therefore, there might be an error in the gem dependency specifications.</li>
<li>         <a title="comment-17369" name="comment-17369"></a> <cite><strong>J2o</strong></cite> on 14 Oct 20:55:<br />
I’m praying that David will change his mind about releasing an updated Rails book for v2. In fact, I’m praying rather hard.</li>
<li>         <a title="comment-17371" name="comment-17371"></a> <cite><strong>Victor</strong></cite> on 15 Oct 05:07:<br />
I looked further into the problem mentioned by gissmoh, piku, and iGl because I desperately needed rails 2 tonight (long story).My conclusion: the rails gem spec has the right build numbers, but the wrong minor version numbers for all dependencies.Workaround: 1) install all dependencies by hand with gem install <strong>dep-name</strong> —-source http://gems.rubyonrails.org 2) install rails with gem install rails -f—source http://gems.rubyonrails.org/ (so gems doesn’t complain about dependencies)the dependencies are: activesupport, activerecord, actionpack, actionmailer, and activeresource (this one is referenced correctly)Solution: update the gemspec please</li>
<li>         <a title="comment-17372" name="comment-17372"></a> <cite><strong>Victor</strong></cite> on 15 Oct 05:14:<br />
I forgot to mention… for the workaround, you need to modify the gem specs in your local “gem” directory after you use the method I described above. You need to modify rails and activeresource.</li>
<li>         <a title="comment-17373" name="comment-17373"></a> <cite><strong>Sam Granieri</strong></cite> on 15 Oct 05:23:<br />
Here’s the last word: Try this  sudo gem install rails—source http://gems.rubyonrails.org -v 1.2.3.7707</li>
<li>         <a title="comment-17376" name="comment-17376"></a> <cite><strong>iGL</strong></cite> on 15 Oct 12:34:<br />
Victor, Sam,  Thank you.</li>
<li>         <a title="comment-17379" name="comment-17379"></a> <cite><strong>zeligf</strong></cite> on 15 Oct 16:34:<br />
since activeresource depends on activesupport and the minor numbers don’t work. The only way now isgem install activesupport activerecord actionpack actionmailerthengem install -f activeresourcethengem intall -f rails</li>
<li>         <a title="comment-17381" name="comment-17381"></a> <cite><strong>Jeremy Kemper</strong></cite> on 15 Oct 18:36:<br />
Sorry for the confusion, all! The 2.0 preview release gem versions + dependencies have been corrected. Please update.</li>
<li>         <a title="comment-17382" name="comment-17382"></a> <cite><strong>gissmoh</strong></cite> on 15 Oct 18:50:<br />
Yäsli! Everything works again! Great! Thanx!!!!</li>
<li>         <a title="comment-17383" name="comment-17383"></a> <cite><strong>zeligf</strong></cite> on 15 Oct 19:34:<br />
&#8230;and it works! thanks to jeremy &amp; co time to get my hands dirty…</li>
<li>         <a title="comment-17385" name="comment-17385"></a> <cite><strong>Adam Jones</strong></cite> on 16 Oct 11:15:<br />
gem install rails—source http://gems.rubyonrails.org  installs rails 1.2.5 not the 2.o preview release?</li>
<li>         <a title="comment-17386" name="comment-17386"></a> <cite><strong>ed</strong></cite> on 16 Oct 13:43:<br />
Adam, that’s what I got. (Maybe).</li>
<li>         <a title="comment-17397" name="comment-17397"></a> <cite><strong>thq</strong></cite> on 17 Oct 02:31:<br />
J2o, Addison-Wesley will release The Rails Way in 20 Nov. If we see on toc, seem it covers Rails 2.0. It’s also very complete.</li>
<li>         <a title="comment-17420" name="comment-17420"></a> <cite><strong>Cristiano Betta</strong></cite> on 17 Oct 13:20:<br />
I’m trying out 2.0 but need the autocomplete_for gem. simply running “gem install autocomplete_for” doesn’t seem to work, what would the proper command be?s</li>
<li>         <a title="comment-17442" name="comment-17442"></a> <cite><strong>Redmar Kerkhoff</strong></cite> on 18 Oct 07:26:<br />
script/plugin install http://svn.rubyonrails.org/rails/plugins/auto_complete ?</li>
<li>         <a title="comment-17453" name="comment-17453"></a> <cite><strong>Cristiano Betta</strong></cite> on 18 Oct 15:49:<br />
Tnx, just what I needed to know.</li>
<li>         <a title="comment-17462" name="comment-17462"></a> <cite><strong>Sven</strong></cite> on 19 Oct 00:56:<br />
I was hoping the update would resolve the problem I posted above (messages 101 and 102), but no such luck. I installed the 1.2.5.7919 Rails gems, created a new project, installed acts_as_attachment, and ran rake test\plugins. The result was basically the same: “can’t activate rails (= 1.2.5), already activated rails-1.2.5.7919]”.So I tried gem cleanup rails, which left just the 1.2.5.7919 version, and repeated the steps above. This way it fails a little differently:</p>
<pre><code>`gem_original_require': no such file to load -- breakpoint (MissingSourceFile)

       from [...]/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'</code></pre>
<p>Can anyone offer any help resolving this?</li>
<li>         <a title="comment-17463" name="comment-17463"></a> <cite><strong>Jeremy Kemper</strong></cite> on 19 Oct 01:06:<br />
All: please take any support issues to the mailing list or <span class="caps">IRC</span> so we can more effectively iron them out for the next release. Thanks!</li>
<li>         <a title="comment-17494" name="comment-17494"></a> <cite><strong>JALE</strong></cite> on 21 Oct 09:16:<br />
Is there an anticipated date for a 2.0 <span class="caps">AWDR</span> book?</li>
<li>         <a title="comment-17498" name="comment-17498"></a> <cite><strong>Enterprise</strong></cite> on 21 Oct 15:51:<br />
Fuck You <span class="caps">DHH</span></li>
<li>         <a title="comment-17507" name="comment-17507"></a> <cite><strong>dusty</strong></cite> on 22 Oct 15:40:<br />
I’d really love to see the benchmarks comparing 2.0 to merb and others.  Are those available anywhere?</li>
<li>         <a title="comment-17603" name="comment-17603"></a> <cite><strong>streuth</strong></cite> on 24 Oct 18:12:<br />
Are there any sample projects built with 2.0?</li>
<li>         <a title="comment-17612" name="comment-17612"></a> <cite><strong>meschach</strong></cite> on 25 Oct 02:52:<br />
Fuck you Enterprise</li>
<li>         <a title="comment-17682" name="comment-17682"></a> <cite><strong>Jamal</strong></cite> on 29 Oct 09:55:<br />
I still get the wrong version installed????</p>
<h1>sudo gem install rails—source http://gems.rubyonrails.org</h1>
<p>Password: Successfully installed rails-1.2.5.7919</p>
<p>Please tell me what I’m doing wrong???</li>
<li>         <a title="comment-17687" name="comment-17687"></a> <cite><strong>Thomas</strong></cite> on 29 Oct 17:30:<br />
Why isn’t autotest working with Rails as excepted I got too many errors throwing on the screen???</li>
<li>         <a title="comment-17689" name="comment-17689"></a> <cite><strong>Gaius</strong></cite> on 29 Oct 20:59:<br />
I’m a bit confused on one thing with the mime_types and iPhone thing:How do I render the same template with two different layouts? For example, I’ve got a PostsController with a #new action, and layout = :site</p>
<h1>adjust_format_for_iphone changes the request, which means it wants both</h1>
<p>-a template in /app/views/posts/new.iphone.erb</p>
<p>-a layout in /app/views/layouts/site.iphone.erb</p>
<p>I really don’t want to have to copy my layout from /app/views/posts/new.html.erb to the iphone version; I just want the layout changed. (In some cases, I want both, but not always. For example, some pages need to have abbreviated content, not just a changed layout; other pages can have the normal content.)</p>
<p>Suggestions?  Some sort of render :template that includes the format?</li>
</ol>
<p>regards</p>
<p>M.K.Jeevika</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mkjeevika.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mkjeevika.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mkjeevika.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mkjeevika.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mkjeevika.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mkjeevika.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mkjeevika.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mkjeevika.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mkjeevika.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mkjeevika.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mkjeevika.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mkjeevika.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mkjeevika.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mkjeevika.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mkjeevika.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mkjeevika.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mkjeevika.wordpress.com&amp;blog=2263209&amp;post=1&amp;subd=mkjeevika&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mkjeevika.wordpress.com/2007/12/05/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f6ae9b692f1f10d52af05656fa66f8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeevika</media:title>
		</media:content>
	</item>
	</channel>
</rss>
