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

<channel>
	<title>cakebaker &#187; ruby on rails</title>
	<atom:link href="http://cakebaker.42dh.com/tags/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 20 Dec 2011 15:29:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cucumber: Switching from Webrat to Capybara</title>
		<link>http://cakebaker.42dh.com/2010/09/19/cucumber-switching-from-webrat-to-capybara/</link>
		<comments>http://cakebaker.42dh.com/2010/09/19/cucumber-switching-from-webrat-to-capybara/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 14:24:43 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cucumber]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1441</guid>
		<description><![CDATA[My current testing tool of choice is Cucumber. Cucumber itself integrates well with other tools. One of those tools is Webrat, which allows you to access your application without a browser and to perform actions like clicking on a link or filling out forms. It works fine with Rails 2.3.x, but not with Rails 3 [...]]]></description>
			<content:encoded><![CDATA[<p>My current testing tool of choice is <a href="http://cukes.info/">Cucumber</a>. Cucumber itself integrates well with other tools. One of those tools is <a href="http://github.com/brynary/webrat">Webrat</a>, which allows you to access your application without a browser and to perform actions like clicking on a link or filling out forms. It works fine with Rails 2.3.x, but not with Rails 3 (at least I was not able to make it work, and on <a href="http://www.railsplugins.org/plugins/26-webrat">RailsPlugins.org</a> the current version of Webrat, 0.7.2.beta.1, is listed as &#8220;Maybe [working] with Rails 3&#8243;). Fortunately, there is an alternative working with both Rails versions: <a href="http://github.com/jnicklas/capybara">Capybara</a>. And so I decided to make the switch from Webrat to Capybara. </p>
<p>Before making the switch, I recommend to run your Cucumber tests to ensure all tests pass:</p>
<pre>
<code>$ cucumber features</code>
</pre>
<p>As usual when adding new dependencies, you have to modify the Gemfile of your app. Replace the Webrat entry with:</p>
<pre>
<code>gem "capybara", "0.3.9"</code>
</pre>
<p>and run:</p>
<pre>
<code>$ bundle update</code>
</pre>
<p>With Capybara installed, you have to setup Cucumber to use Capybara by running one of the following commands:</p>
<pre>
<code>// Rails 2.3.9
$ script/generate cucumber --rspec --capybara

// Rails 3.0.0
$ rails generate cucumber:install --rspec --capybara</code>
</pre>
<p>Now, you are ready to run the tests again. If you are lucky, all tests pass, which means there is nothing more to do. However, I think it is more likely you will get a bunch of errors and maybe even some failing tests. </p>
<p>The errors I got were &#8220;undefined method&#8221; errors. They are relatively easy to fix by replacing the no longer existing Webrat methods with their Capybara counterparts. In the following code block I list some examples:</p>
<pre>
<code># Webrat
field_with_id('openid_identifier').value.should =~ /invalid OpenID/
# Capybara
find_field('openid_identifier').value.should =~ /invalid OpenID/

# Webrat
response.should contain('Previous')
# Capybara
page.should have_content('Previous')

# Webrat
assert_have_selector('.author', :count =&gt; 1)
# Capybara
page.should have_css('.author', :count =&gt; 1)

# Webrat
assert_have_xpath("//span[@id='#{id}']", :content =&gt; expected_count)
# Capybara
page.should have_xpath("//span[@id='#{id}']", :text =&gt; expected_count)</code>
</pre>
<p>The trickiest part to fix was the failing test. To test some &#8220;remember me&#8221; functionality I manually set a cookie, and this no longer worked with Capybara: </p>
<pre>
<code>cookies[:remember_me_id] = remember_me_id</code>
</pre>
<p>After some searching I found a <a href="http://gist.github.com/484787">Gist</a> from Nicholas Rutherford in which he dealt with cookies. Thanks to his code I could set my cookie with the following snippet:</p>
<pre>
<code>cookies = Capybara.current_session.driver.current_session.instance_variable_get(:@rack_mock_session).cookie_jar
cookies[:remember_me_id] = remember_me_id</code>
</pre>
<p>And with that, my switch to Capybara was complete. Any questions?</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2010/09/19/cucumber-switching-from-webrat-to-capybara/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Rails 3 and Passenger</title>
		<link>http://cakebaker.42dh.com/2010/01/17/rails-3-and-passenger/</link>
		<comments>http://cakebaker.42dh.com/2010/01/17/rails-3-and-passenger/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 09:46:06 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1333</guid>
		<description><![CDATA[This weekend the RailsBridge people have organized a bugmash with the motto &#8220;Do One Thing for Rails 3&#8243;, and so I took the opportunity to experiment a bit with the coming Rails 3. After following the instructions for creating a new Rails 3 app (using the &#8211;database=mysql parameter for the &#8220;rails&#8221; command) I noticed that [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend the <a href="http://railsbridge.org">RailsBridge</a> people have organized a <a href="http://bugmash.com">bugmash</a> with the motto &#8220;Do One Thing for Rails 3&#8243;, and so I took the opportunity to experiment a bit with the coming Rails 3.</p>
<p>After following the instructions for <a href="http://yehudakatz.com/2009/12/31/spinning-up-a-new-rails-app/">creating a new Rails 3 app</a> (using the &#8211;database=mysql parameter for the &#8220;rails&#8221; command) I noticed that the application tried to access the (not existing) production database. That was a bit strange, because I expected it to access the development database as I set the <a href="http://www.modrails.com/documentation/Users guide.html#rails_env">RailsEnv</a> option of <a href="http://www.modrails.com">Passenger</a> accordingly:</p>
<pre>
<code># for example in /etc/httpd/conf/httpd.conf
RailsEnv development</code>
</pre>
<p>The reason this doesn&#8217;t work is because the generated application contains a &#8220;config.ru&#8221; file. In this case, Passenger treats the application as a <a href="http://rack.rubyforge.org/">Rack</a> application and not as a Rails application. And so the RailsEnv setting is ignored as it is Rails-specific&#8230;</p>
<p>There are two ways to run the application in development mode: you can either remove the &#8220;config.ru&#8221; file (and keep the RailsEnv setting) or you can set the <a href="http://www.modrails.com/documentation/Users guide.html#rack_env">RackEnv</a> option:</p>
<pre>
<code># for example in /etc/httpd/conf/httpd.conf
RackEnv development</code>
</pre>
<p>Have fun with Rails 3 :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2010/01/17/rails-3-and-passenger/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Render partial from an atom builder view</title>
		<link>http://cakebaker.42dh.com/2009/11/27/render-partial-from-an-atom-builder-view/</link>
		<comments>http://cakebaker.42dh.com/2009/11/27/render-partial-from-an-atom-builder-view/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 16:15:52 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1302</guid>
		<description><![CDATA[Thanks to the built-in AtomFeedHelper it is quite easy to generate an atom feed with Rails. Here an example from the API: # app/views/posts/index.atom.builder atom_feed do &#124;feed&#124; feed.title("My great blog!") feed.updated(@posts.first.created_at) @posts.each do &#124;post&#124; feed.entry(post) do &#124;entry&#124; entry.title(post.title) entry.content(post.body, :type =&#62; 'html') entry.author do &#124;author&#124; author.name("DHH") end end end end The code should be self-explanatory [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to the built-in <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AtomFeedHelper.html">AtomFeedHelper</a> it is quite easy to generate an atom feed with Rails. </p>
<p>Here an example from the API:</p>
<pre>
<code># app/views/posts/index.atom.builder
atom_feed do |feed|
  feed.title("My great blog!")
  feed.updated(@posts.first.created_at)

  @posts.each do |post|
    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</code>
</pre>
<p>The code should be self-explanatory (if not, please leave a comment). </p>
<p>Recently, I had two such views which were almost identical, the only difference was the feed title. And that&#8217;s of course not really <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a>. </p>
<p>One possible approach to fix this &#8220;issue&#8221; is to set an instance variable with the feed title in the controller and render the same view in both cases. As I don&#8217;t like to set view titles (resp. feed titles in this case) in the controller, I decided to use a partial. </p>
<p>And so I put the code from above into a partial (plus changing the instance variable &#8220;@posts&#8221; to a local variable &#8220;posts&#8221; and introducing a new local variable &#8220;feed_title&#8221;), and tried to use this partial (app/views/shared/_feed.atom.builder) in the following way:</p>
<pre>
<code># app/views/posts/index.atom.builder
render :partial =&gt; 'shared/feed', :locals =&gt; {:feed_title =&gt; "My Posts", :posts =&gt; @posts}</code>
</pre>
<p>Well, it didn&#8217;t work. No output was generated. </p>
<p>After experimenting a bit I found the following solution by moving the outer-most block definition from the partial to the views:</p>
<pre>
<code># app/views/posts/index.atom.builder
atom_feed do |feed|
  render :partial =&gt; 'shared/feed', :locals =&gt; {:feed =&gt; feed, :feed_title =&gt; "My Posts", :posts =&gt; @posts}
end</code>
</pre>
<p>I don&#8217;t know whether this is the best solution (probably not), but it is definitely better than what I had previously ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/11/27/render-partial-from-an-atom-builder-view/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rails 2.3.4 and Ruby 1.9.1</title>
		<link>http://cakebaker.42dh.com/2009/09/14/rails-2-3-4-and-ruby-1-9-1/</link>
		<comments>http://cakebaker.42dh.com/2009/09/14/rails-2-3-4-and-ruby-1-9-1/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 09:43:55 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[problem]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1255</guid>
		<description><![CDATA[This morning, the Ruby package for Arch Linux was upgraded from version 1.8.7 to 1.9.1. Unfortunately, after the upgrade all Rails applications (using Rails 2.3.4) stopped to work and showed an error like: undefined method `^' for "b":String (NoMethodError) Fortunately, I am not the first one who encountered this issue, and so it is already [...]]]></description>
			<content:encoded><![CDATA[<p>This morning, the Ruby package for <a href="http://www.archlinux.org">Arch Linux</a> was upgraded from version 1.8.7 to 1.9.1. Unfortunately, after the upgrade all Rails applications (using Rails 2.3.4) stopped to work and showed an error like:</p>
<pre>
<code>undefined method `^' for "b":String (NoMethodError)</code>
</pre>
<p>Fortunately, I am not the first one who encountered <a href="https://rails.lighthouseapp.com/projects/8994/tickets/3144-undefined-method-for-string-ror-234">this issue</a>, and so it is already fixed in the <a href="http://github.com/rails/rails">Rails git repository</a>. To fix it on my local installation, I simply had to replace /&lt;path_to_ruby_gems&gt;/activesupport-2.3.4/lib/active_support/message_verifier.rb with the corresponding file from the git repository. And with that, my applications started to work again :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/09/14/rails-2-3-4-and-ruby-1-9-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Whenever</title>
		<link>http://cakebaker.42dh.com/2009/06/15/whenever/</link>
		<comments>http://cakebaker.42dh.com/2009/06/15/whenever/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 15:34:28 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1204</guid>
		<description><![CDATA[Most web applications have to perform some periodic tasks. For this purpose, you usually define some cron jobs. With the &#8220;whenever&#8221; Ruby gem you can define those cron jobs directly in your Rails application. After installing the gem (with &#8220;gem install javan-whenever&#8221;) you either have to create the file &#8220;/config/schedule.rb&#8221; manually, or you can use [...]]]></description>
			<content:encoded><![CDATA[<p>Most web applications have to perform some periodic tasks. For this purpose, you usually define some <a href="http://en.wikipedia.org/wiki/Cron">cron jobs</a>.</p>
<p>With the <a href="http://github.com/javan/whenever/tree/master">&#8220;whenever&#8221;</a> Ruby gem you can define those cron jobs directly in your Rails application. </p>
<p>After installing the gem (with &#8220;gem install javan-whenever&#8221;) you either have to create the file &#8220;/config/schedule.rb&#8221; manually, or you can use &#8220;wheneverize&#8221; to generate this file (call &#8220;wheneverize .&#8221; from your project root). You can then add your application-specific cron jobs to this file. </p>
<p>For example, let&#8217;s say you want to clean up the users table and remove all users who didn&#8217;t activate their accounts, then you would write something like:</p>
<pre>
<code>every 1.day, :at =&gt; '2am' do
  runner "User.cleanup_inactive_users"
end</code>
</pre>
<p>This will execute the &#8220;cleanup_inactive_users&#8221; method of the &#8220;User&#8221; model daily at 2am (you could also use &#8220;every :friday do&#8221; to run it every friday, or &#8220;every 2.hours do&#8221; to run it every two hours, and so on) . The &#8220;runner&#8221; keyword allows you to execute Ruby code (it uses &#8220;script/runner&#8221;, hence the name). You can also use &#8220;command&#8221; to execute command line tools, or &#8220;rake&#8221; for running rake tasks. </p>
<p>So far we simply described our cron job, though no cron job is active yet. To change this, we have to tell cron about our cron job with:</p>
<pre>
<code>whenever --update-crontab example</code>
</pre>
<p>&#8220;example&#8221; is a unique identifier for our application, and is used by &#8220;whenever&#8221; to determine which cron jobs it has to modify when you update &#8220;schedule.rb&#8221; and re-run the above command. It is probably best to put this command in the deployment script of your application to keep your cron jobs up-to-date.</p>
<p>With &#8220;crontab -l&#8221; we can see the job(s) added by &#8220;whenever&#8221;:</p>
<pre>
<code># Begin Whenever generated tasks for: example
0 2 * * * /home/dho/projects/example/script/runner -e production "User.cleanup_inactive_users"
# End Whenever generated tasks for: example</code>
</pre>
<p>With that, our cron job should be executed like any other cron job on our system. </p>
<p>I hope I could give you a short overview about this quite useful gem, for more information see:<br />
<a href="http://github.com/javan/whenever/tree/master">http://github.com/javan/whenever</a><br />
<a href="http://asciicasts.com/episodes/164-cron-in-ruby">ASCIIcasts &#8220;Episode 164 &#8211; Cron in Ruby&#8221;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/06/15/whenever/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Migration from Rails 2.2 to 2.3</title>
		<link>http://cakebaker.42dh.com/2009/05/07/migration-from-rails-22-to-23/</link>
		<comments>http://cakebaker.42dh.com/2009/05/07/migration-from-rails-22-to-23/#comments</comments>
		<pubDate>Thu, 07 May 2009 07:47:32 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1175</guid>
		<description><![CDATA[Recently, I migrated from Rails 2.2 to 2.3. After installing the new Rails gem I generated a dummy project to compare the generated project structure with the structure of a Rails 2.2 project to find out what changed. And those are the things I had to change (though most changes seem to be optional): Renaming [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I migrated from Rails 2.2 to 2.3. After installing the new Rails gem I generated a dummy project to compare the generated project structure with the structure of a Rails 2.2 project to find out what changed.</p>
<p>And those are the things I had to change (though most changes seem to be optional):</p>
<ul>
<li>Renaming app/controllers/application.rb to app/controllers/application_controller.rb</li>
<li>Replacing config/boot.rb, as it was slightly modified</li>
<li>Adding the new &#8220;reconnect&#8221; option for MySQL databases to config/database.yml (see the <a href="http://guides.rubyonrails.org/2_3_release_notes.html#reconnecting-mysql-connections">release notes</a>)</li>
<li>Moving the settings for &#8220;config.action_controller.session&#8221; and &#8220;config.action_controller.session_storage&#8221; from config/environment.rb to the new file config/initializers/session_store.rb</li>
<li>Changing the value of RAILS_GEM_VERSION from 2.2.2 to 2.3.2 in config/environment.rb</li>
<li>Copying config/initializers/backtrace_silencers.rb to my project</li>
<li>Adding the setting &#8220;config.action_view.cache_template_loading = true&#8221; to the production and testing environments (config/environments/production.rb resp. test.rb)</li>
<li>Removing the dispatch scripts from the &#8220;public&#8221; directory, the script/process directory (and its content), plus the &#8220;request&#8221; script from script/performance </li>
</ul>
<p>A detailed overview of the changes/new features of Rails 2.3 can be found in the <a href="http://guides.rubyonrails.org/2_3_release_notes.html">release notes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/05/07/migration-from-rails-22-to-23/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Generating a Rails project configured to use MySQL</title>
		<link>http://cakebaker.42dh.com/2009/03/13/generating-a-rails-project-configured-to-use-mysql/</link>
		<comments>http://cakebaker.42dh.com/2009/03/13/generating-a-rails-project-configured-to-use-mysql/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 16:55:23 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1137</guid>
		<description><![CDATA[A little trap I blundered into each time I generated a Rails project with $ rails example // Rails 2.x $ rails new example // Rails 3.x is that by default a generated project is configured to use a SQLite database. And so the configuration file for the databases looks as shown below (I omit [...]]]></description>
			<content:encoded><![CDATA[<p>A little trap I blundered into each time I generated a Rails project with</p>
<pre>
<code>$ rails example // Rails 2.x
$ rails new example // Rails 3.x</code>
</pre>
<p>is that by default a generated project is configured to use a <a href="http://sqlite.org/">SQLite</a> database. And so the configuration file for the databases looks as shown below (I omit the configurations for the &#8220;test&#8221; and &#8220;production&#8221; environments, as they are almost identical):</p>
<pre>
<code># example/config/database.yml
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000</code>
</pre>
<p>This leads, of course, to an error as soon as you try to access the database while there is no such driver installed ;-)</p>
<p>To avoid this small problem, you have to specify the database type when using the &#8220;rails&#8221; command:</p>
<pre>
<code>$ rails -d mysql example // Rails 2.x
$ rails new example -d mysql // Rails 3.x</code>
</pre>
<p>This command then generates the following database.yml:</p>
<pre>
<code># example/config/database.yml
development:
  adapter: mysql  # Rails 3.x uses the mysql2 adapter
  encoding: utf8
  database: example_development
  pool: 5
  username: root
  password:
  socket: /var/run/mysqld/mysqld.sock</code>
</pre>
<p>Happy Rails baking!</p>
<p>Update 2009-03-23: An alternative approach in Rails 2.x is to define the variable RAILS_DEFAULT_DATABASE with:</p>
<pre>
<code>$ export RAILS_DEFAULT_DATABASE=mysql</code>
</pre>
<p>Update 2011-02-20: Adapted for Rails3</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/03/13/generating-a-rails-project-configured-to-use-mysql/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Installing Rails Plugins from a Git repository</title>
		<link>http://cakebaker.42dh.com/2009/02/19/installing-rails-plugins-from-a-git-repository/</link>
		<comments>http://cakebaker.42dh.com/2009/02/19/installing-rails-plugins-from-a-git-repository/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 14:51:46 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1114</guid>
		<description><![CDATA[What I learned today is how you can install Rails plugins from Git repositories with a simple command: dho@tumulux:~/projects/myrailsproject$ ./script/plugin install git://github.com/rails/open_id_authentication.git The example command from above will download the OpenIdAuthentication plugin from GitHub and put the plugin in the vendor/plugins directory. Quite handy. In the CakePHP world there is currently no equivalent. However, John [...]]]></description>
			<content:encoded><![CDATA[<p>What I learned today is how you can install Rails plugins from <a href="http://git-scm.com/">Git</a> repositories with a simple command:</p>
<pre>
<code>dho@tumulux:~/projects/myrailsproject$ ./script/plugin install git://github.com/rails/open_id_authentication.git</code>
</pre>
<p>The example command from above will download the OpenIdAuthentication plugin from GitHub and put the plugin in the vendor/plugins directory. Quite handy.</p>
<p>In the CakePHP world there is currently no equivalent. However, <a href="http://twitter.com/raisinbread">John David Anderson</a> (aka _psychic_) recently published an early version of a <a href="http://plugins.thoughtglade.com/">Plugins shell console application</a> to manage plugins.</p>
<p>Happy working with plugins!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/02/19/installing-rails-plugins-from-a-git-repository/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Magic timestamps with Rails and CakePHP</title>
		<link>http://cakebaker.42dh.com/2009/02/16/magic-timestamps-with-rails-and-cakephp/</link>
		<comments>http://cakebaker.42dh.com/2009/02/16/magic-timestamps-with-rails-and-cakephp/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 16:19:34 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1108</guid>
		<description><![CDATA[Both frameworks provide the feature of automatically setting the creation/modification datetime of a database record. For this feature to work, you have to add datetime columns to your tables which follow some naming conventions. For some reason, CakePHP uses different conventions for this feature than Rails&#8230; In CakePHP, the names of those &#8220;magic&#8221; columns are: [...]]]></description>
			<content:encoded><![CDATA[<p>Both frameworks provide the feature of automatically setting the creation/modification datetime of a database record. For this feature to work, you have to add datetime columns to your tables which follow some naming conventions. For some reason, CakePHP uses different conventions for this feature than Rails&#8230;</p>
<p>In CakePHP, the names of those &#8220;magic&#8221; columns are:</p>
<pre>
<code>created
modified / updated</code>
</pre>
<p>In Rails, on the other hand, the respective column names are:</p>
<pre>
<code>created_at / created_on
updated_at / updated_on</code>
</pre>
<p>Fortunately, the other database-related naming conventions seem to be the same in both frameworks.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/02/16/magic-timestamps-with-rails-and-cakephp/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Setting the DocumentRoot for Rails and CakePHP Applications</title>
		<link>http://cakebaker.42dh.com/2009/02/11/setting-the-documentroot-for-rails-and-cakephp-applications/</link>
		<comments>http://cakebaker.42dh.com/2009/02/11/setting-the-documentroot-for-rails-and-cakephp-applications/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 15:16:46 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1103</guid>
		<description><![CDATA[One of the first steps when I start a new project is to define a virtual host for the project because I prefer urls in the format http://myproject.localhost over http://localhost/myproject on my local development machine. As I currently use Apache2 for both, Rails (using mod_rails) and CakePHP, a virtual host entry in /etc/apache2/sites-available/default looks like: [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first steps when I start a new project is to define a virtual host for the project because I prefer urls in the format http://myproject.localhost over http://localhost/myproject on my local development machine. </p>
<p>As I currently use Apache2 for both, Rails (using <a href="http://www.modrails.com/">mod_rails</a>) and CakePHP, a virtual host entry in /etc/apache2/sites-available/default looks like:</p>
<pre>
<code>&lt;VirtualHost *:80&gt;
    ServerName myproject.localhost
    DocumentRoot /&lt;path_to_document_root_of_myproject&gt;
&lt;/VirtualHost&gt;</code>
</pre>
<p>If you have a CakePHP project, the path to the DocumentRoot is usually something like:</p>
<pre>
<code>DocumentRoot /&lt;path_to_the_projects&gt;/myproject/app/webroot</code>
</pre>
<p>With Rails, on the other hand, the path to the DocumentRoot is something like:</p>
<pre>
<code>DocumentRoot /&lt;path_to_the_projects&gt;/myproject/public</code>
</pre>
<p>After a restart of Apache you should get the welcome screen of the respective framework if you go to http://myproject.localhost (assuming you already &#8220;baked&#8221; the project structure and added an entry to the /etc/hosts file).</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/02/11/setting-the-documentroot-for-rails-and-cakephp-applications/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

