<?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>Earl C. Ruby III &#187; Ruby on Rails</title>
	<atom:link href="http://earlruby.org/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://earlruby.org</link>
	<description>this must be the place</description>
	<lastBuildDate>Tue, 01 May 2012 02:56:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting ActiveScaffold to work under Ruby on Rails 2.3</title>
		<link>http://earlruby.org/2009/06/getting-activescaffold-to-work-under-ruby-on-rails-23/</link>
		<comments>http://earlruby.org/2009/06/getting-activescaffold-to-work-under-ruby-on-rails-23/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 23:01:10 +0000</pubDate>
		<dc:creator>Earl Ruby</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[ActiveScaffold]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[RoR 2.3]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails 2.3]]></category>

		<guid isPermaLink="false">http://earlruby.org/?p=84</guid>
		<description><![CDATA[I had started an application using Ruby on Rails and I wanted to try out ActiveScaffold as a replacement for standard scaffolding. I&#8217;d seen ActiveScaffold in action before but I&#8217;d never used it. I knew that ActiveScaffold dynamically generates application pages using a standard format, and if you change the format it updates all of [...]]]></description>
			<content:encoded><![CDATA[<p>I had started an application using <a href="http://rubyonrails.org/">Ruby on Rails</a> and I wanted to try out <a href="http://activescaffold.com/">ActiveScaffold</a> as a replacement for standard scaffolding. I&#8217;d seen ActiveScaffold in action before but I&#8217;d never used it. I knew that ActiveScaffold dynamically generates application pages using a standard format, and if you change the format it updates all of your application&#8217;s pages &#8212; unlike standard scaffolding where you have to tweak each and every page. For the application I&#8217;m working on it sounded like a huge time-saver, so I decided to try it out.</p>
<p>I was trying to install ActiveScaffold for Ruby on Rails using the steps shown on the <a href="”http://activescaffold.com/tutorials/getting-started”">Active Scaffold – Getting Started tutorial</a>. However, when I installed ActiveScaffold using the instructions the <a href="http://mongrel.rubyforge.org/">Mongrel web server</a> I use for development would die as soon as I tried to restart it, dumping a large list of errors:</p>
<pre>earl@earl:~/projects/TotalWorldDomination &gt; script/server
=&gt; Booting Mongrel
=&gt; Rails 2.3.2 application starting on http://0.0.0.0:3000
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/
module/aliasing.rb:33:in `alias_method': undefined method `_pick_template'
for class `ActionView::Base' (NameError)
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/
core_ext/module/aliasing.rb:33:in `alias_method_chain'
</pre>
<p>&#8230; and the error messages continued, filling up the entire screen.</p>
<p>I quickly figured out that the problem was that I was using Rails 2.3.2, and the release version of ActiveScaffold was for Rails 2.2.x. The tutorial was for Rails 2.2.x, not 2.3.x.</p>
<p>Since I&#8217;d just commited all of my changes to my Subversion repository before installing ActiveScaffold I reverted to the previous version of my application, removing any files installed by ActiveScaffold.</p>
<p>I checked the <a href="http://github.com/activescaffold/active_scaffold/tree/master">README for ActiveScaffold on GitHub</a> and installed the following branches:</p>
<pre>script/plugin install git://github.com/activescaffold/active_scaffold.git -r master
script/plugin install git://github.com/ewildgoose/render_component.git -r rails-2.3</pre>
<p>After that Mongrel loads just fine:</p>
<pre>earl@earl:~/projects/TotalWorldDomination &gt; script/server
=&gt; Booting Mongrel
=&gt; Rails 2.3.2 application starting on http://0.0.0.0:3000
=&gt; Call with -d to detach
=&gt; Ctrl-C to shutdown server</pre>
<p>Following the <a href="”http://activescaffold.com/tutorials/”">tutorial</a> I added this to my layout:</p>
<pre>&lt;%= javascript_include_tag :defaults %&gt;
&lt;%= active_scaffold_includes %&gt;</pre>
<p>And I added this to one of my controllers (just so I could test out ActiveScaffold with one model):</p>
<pre>  layout "admin"
  active_scaffold</pre>
<p>At this point if I try to pull up a view for the controller I just modified I get a “Template is missing &#8211; Missing template admin.erb in view path vendor/plugins/active_scaffold/frontends/default/views” error.</p>
<p><img src="http://earlruby.org/wp-content/uploads/2009/06/activescaffold-missing-admin-view.jpg" alt="Active Scaffold - missing admin view" /></p>
<p>This error is misleading, since (checking GitHub) there are no admin.* files in  active_scaffold/frontends/default/views in any of the four ActiveScaffold branches. It&#8217;s not a view that comes built into ActiveScaffold, even though the tutorial makes it sound like a built-in layout, it&#8217;s the name of a layout file for your application.</p>
<p>In my case the layout that I&#8217;d modified in the previous step was application.html.erb, and it was the only layout in my small application. I made a copy of the file named admin.html.erb:</p>
<pre>cd app/views/layouts
cp application.html.erb admin.html.erb</pre>
<p>Then following advice I found in the <a href="”http://groups.google.com/group/activescaffold/browse_thread/thread/25f33ac36b11c5ad/afd0f547050e3df5?lnk=gst&amp;q=getting+started#afd0f547050e3df5”">ActiveScaffold forums</a> I <strong>commented out everything in all of my standard-scaffold-generated  controllers</strong>, leaving only the lines:</p>
<pre>  layout "admin"
  active_scaffold</pre>
<p>&#8230; in between the &#8220;class&#8221; and &#8220;end&#8221; lines for each controller.</p>
<p>Once I did that ActiveScaffold worked fine.</p>
<p>One note: If you do get any “Request Failed (code 500, Internal Error)” errors, check log/development.log for hints about what&#8217;s going on, it&#8217;ll usually tell you what the problem is.</p>
<p>Hope you found this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://earlruby.org/2009/06/getting-activescaffold-to-work-under-ruby-on-rails-23/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

