<?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>Meta Bates &#187; blog</title>
	<atom:link href="http://www.metabates.com/tag/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.metabates.com</link>
	<description>The technical ramblings of Mark Bates.</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:25:34 +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>Becoming an &#8216;Expert&#8217; Developer</title>
		<link>http://www.metabates.com/2010/11/17/becoming-an-expert-developer/</link>
		<comments>http://www.metabates.com/2010/11/17/becoming-an-expert-developer/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 15:50:16 +0000</pubDate>
		<dc:creator>Mark Bates</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[github.com]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.metabates.com/?p=387</guid>
		<description><![CDATA[Last week I received an email from someone who used to work at a company that I used to work with. I didn&#8217;t know him, but he knew me through my work at the company, and my other exploits. He sent me an email to say that after a short time with the company he [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I received an email from someone who used to work at a company that I used to work with. I didn&#8217;t know him, but he knew me through my work at the company, and my other exploits. He sent me an email to say that after a short time with the company he had been laid off, along with half of the development team. He wasn&#8217;t looking for pity, but rather advice.</p>
<p>What kind of advice was he asking for, well, he quite simply needed to know how could he become an &#8216;expert&#8217; Ruby on Rails developer. First, let me say that this post won&#8217;t have anything to do with Ruby, Rails, or any other specific programming language. Everything I&#8217;ll talk about is valid in ANY language on ANY platform. With that disclaimer, let&#8217;s move on, shall we?</p>
<p><img class="alignleft" title="Monkey" src="http://herd.typepad.com/.a/6a00d83451e1dc69e2010536ad3deb970b-800wi" alt="" width="250" /></p>
<p>While at this company he got introduced to Ruby on Rails and really loved it, coming from a non-Rails background. Since being laid off he&#8217;s been trying to land another Rails gig, but everyone is looking for &#8216;expert&#8217; Rails developers. So the question was, how to become an &#8216;expert&#8217; developer?</p>
<p>I keep putting &#8216;expert&#8217; in quotes because, let&#8217;s be honest here, that&#8217;s a VERY subjective term. As someone who has hired many developers in his day, I can tell you that I&#8217;v</p>
<p>e hired newbies to &#8216;experts&#8217; and everywhere in between. Everyone has their merits and possibilities. I&#8217;ve met &#8216;experts&#8217; that I wouldn&#8217;t hire to take out my trash, let alone build my business. I&#8217;ve also met people right out of college that I would hire again and again. So your mileage my vary.</p>
<p>So&#8230; how do you build up that &#8216;expert&#8217; reputation? Let&#8217;s look at it. Below are some of things I&#8217;ve done, as well as some of the things that I look for as a hiring manager. Some are incredibly easy to do, others require work, but in the end they WILL pay off, and you&#8217;ll easily be at the head of the pack when going for that job.</p>
<h3>Build Something</h3>
<p>When you are looking for a job people want to see what it is you&#8217;ve actually built. If you haven&#8217;t built anything, then how are you an expert? Build a lot of different things and put them up on the web for perspective employers to find and play around with. Use these are a playground for trying out all those cool new technologies you keep hearing about. Want to give NoSQL a try? Great, build an app that uses it. Need to improve your testing chops? Write an application and write all the tests you can possibly think of!</p>
<h3>Get a GitHub Account</h3>
<p>I can&#8217;t tell you how important GitHub has become when trying to make a name for yourself. It seems like unless you&#8217;re on GitHub, you&#8217;re nobody. While that might not be true, it certainly hurts more than it helps to not have an account. You know those apps you&#8217;ve just been building and playing around with? Post them on GitHub! Then put your profile page link on your resume. Yep, you read that right. Give those looking at your resume a link to your code. Let them see how good a developer you actually are. Show them you know how to code all the things you&#8217;ve got on your resume. Listing a language, platform, or tool on resume is one thing, but actually showing your perspective employer is another! They&#8217;ll love it.</p>
<p>While you&#8217;re on GitHub, why not contribute to an open source project that&#8217;s up there. There are plenty of them, and they&#8217;re ALL looking for people to help out with their projects. Simply fork the projects, make some improvements, and then give those changes back to the projects owner. This looks great on a resume and really helps to show that you are interested and active in the community. Again, employers love this! Plus, you&#8217;ll be starting to build a name for yourself, and building a network, and a network is INCREDIBLY important when looking for work.</p>
<h3>Blog and Write</h3>
<p>I should probably heed my own advice here and blog more often, but do as I say, not as I do. <img src='http://www.metabates.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  With that said I wrote a book, which looks AMAZING on a resume, but might be a bit out of reach for most people, so I recommend blogging instead. Why should you blog? Well, it shows that you have good communications skills, again very important to most employers. It can also show that you have a deep understanding of whatever it is you blog about.</p>
<p>What should you write about? If you&#8217;re stuck on a topic, might I make a recommendation or two. First, when you&#8217;re building those applications I mentioned early if you run into a bug or something else that got you a bit stuck, blog about it! Others could really benefit from your experience. Explain the problem and how you went about solving it. Another great thing to write about is your favorite libraries or plugins. Pick a different one each week and dissect it. Write about how it works, what it does, etc&#8230; This is a great exercise in both writing and learning about how things work. Very valuable.</p>
<h3>Network</h3>
<p>I mentioned earlier that a good network is INCREDIBLY important when looking for work, and I wasn&#8217;t lying. It&#8217;s the most important thing. A good network will constantly be feeding you new opportunities, or putting you in touch with those who can. So how do you develop that network? A few ways, I mentioned contributing to open source earlier, that&#8217;s a great way. Another great way is through conferences, hackfests, rumbles, and whatever other local (and non-local) events are being held in your development community of choice. Attend these events, participate, introduce yourself, speak, buy drinks, whatever! Just get out there and NETWORK!!</p>
<h3>Conclusion</h3>
<p>The gentleman who emailed me said that he was reading a lot of books in hopes of becoming an &#8216;expert&#8217;. While I&#8217;m not going to tell you not to read books (you should!!), I will tell you that there is no substitute for doing. All of things I&#8217;ve talked about above are ALL about doing. Reading is not doing, it&#8217;s reading. It&#8217;s passive and will not get you further in your career. There&#8217;s no place on a resume for the books you&#8217;ve read. Take what you&#8217;ve read and put it into action, then you&#8217;ll be on your way to becoming an &#8216;expert&#8217; developer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.metabates.com/2010/11/17/becoming-an-expert-developer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>0.4.6: The Obligatory &#8216;Blog&#8217; Demo &#8211; Take 2</title>
		<link>http://www.metabates.com/2008/04/18/046-the-obligatory-blog-demo-take-2/</link>
		<comments>http://www.metabates.com/2008/04/18/046-the-obligatory-blog-demo-take-2/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 22:12:04 +0000</pubDate>
		<dc:creator>Mark Bates</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[active record]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[data mapper]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[mack]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[scaffold]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.mackframework.com/?p=60</guid>
		<description><![CDATA[This post has moved to the wiki @&#160;http://wiki.mackframework.com/index.php/Blog%20Tutorial]]></description>
			<content:encoded><![CDATA[<p>This post has moved to the wiki @&nbsp;<a href="http://wiki.mackframework.com/index.php/Blog%20Tutorial" target="_blank">http://wiki.mackframework.com/index.php/Blog%20Tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.metabates.com/2008/04/18/046-the-obligatory-blog-demo-take-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>0.3.0: Adding RSS/xml feeds to our Blog demo</title>
		<link>http://www.metabates.com/2008/03/19/adding-rssxml-feeds-to-our-blog-demo/</link>
		<comments>http://www.metabates.com/2008/03/19/adding-rssxml-feeds-to-our-blog-demo/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 20:42:49 +0000</pubDate>
		<dc:creator>Mark Bates</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[mack]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.mackframework.com/2008/03/19/adding-rssxml-feeds-to-our-blog-demo/</guid>
		<description><![CDATA[Ok, as you remember a while back we created a simple blog using mack, http://www.mackframework.com/2008/03/04/the-obligatory-blog-demo/. Well now it&#8217;s time to add the all important RSS/xml feed to it. Mack 0.3.0 introduces xml rendering support natively, so this shouldn&#8217;t be so hard. First things first, let&#8217;s fire up the app, shall we: $ rake server Now [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, as you remember a while back we created a simple blog using mack, <a href="http://www.mackframework.com/2008/03/04/the-obligatory-blog-demo/" target="_blank">http://www.mackframework.com/2008/03/04/the-obligatory-blog-demo/</a>. Well now it&#8217;s time to add the all important RSS/xml feed to it.</p>
<p>Mack 0.3.0 introduces xml rendering support natively, so this shouldn&#8217;t be so hard. First things first, let&#8217;s fire up the app, shall we:</p>
<pre>$ rake server</pre>
<p>Now let&#8217;s head over to http://localhost:3000/posts. We should see our beautiful posts index page. Now let&#8217;s try to go to http://localhost:3000/posts.xml you should see something that looks like this:</p>
<p><img src="http://www.mackframework.com/wp-content/uploads/2008/03/xml1.png" alt="XML blog demo 1" width="450" /></p>
<p>Clearly, that&#8217;s not what we want, is it? I didn&#8217;t think so. The error is telling us that it&#8217;s looking for a file called index.xml.erb in the app/views/posts directory of our blog project. Obviously that file doesn&#8217;t exist.</p>
<p>Let&#8217;s take a second and talk about <em>why</em> Mack was looking for index.xml.erb. We haven&#8217;t changed anything in our controller. Our index method still looks something like this:</p>
<pre>def index
  @posts = Post.find(:all)
end</pre>
<p>No where in there does it mention xml. The only place xml is mentioned is on the the url itself, remember? We looked for /posts.xml. By adding .xml you&#8217;re telling Mack that you want to render, well&#8230; xml. So it goes looking for that. That&#8217;s also new in 0.3.0. The default is html, but if you append a format (.js, .xml, etc&#8230;), it will go looking for app/views/&lt;controller_name&gt;/&lt;action_name&gt;.&lt;format&gt;.erb and render it.</p>
<p>Ok, now that we understand why we&#8217;re looking for an xml file, let&#8217;s fire up our trusty text editor and create a new file called: app/views/posts/index.xml.erb. Let&#8217;s edit the file to look like this:</p>
<pre>xml.instruct! <img src='http://www.metabates.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml, :version=&gt;"1.0"
xml.rss(:version =&gt; "2.0") do
  xml.channel do
    xml.title("My Mack Blog")
    xml.link(posts_index_full_url)
    xml.description("Find out about all the cool stuff happening on my blog!")
    xml.language("en-us")
    xml.copyright("Copyright Me")
    xml.pubDate(CGI.rfc1123_date(Time.now))
    xml.lastBuildDate(CGI.rfc1123_date(Time.now))
    @posts.each do |post|
      xml.entry do
        xml.title(post.title)
        xml.link(posts_show_full_url(:id =&gt; post.id))
        xml.description(post.body)
        xml.pubDate(post.created_at.strftime("%a, %d %b %Y %H:%M:%S"))
      end
    end
  end
end</pre>
<p>Mack uses the standard builder gem library. I&#8217;m not going to go into explaining how that works, there are plenty of other tutorials and documentation that will show you that. I&#8217;m also not going to explain all the necessary pieces of an RSS feed. Instead I&#8217;ll point out in that code you&#8217;ll see we&#8217;re using the @posts instance variable that we set in the index action of our PostsController. Just like regular *.html.erb files we have access to all the instance variables from the controller, as well, helpers, etc&#8230;</p>
<p>So now if we go to http://localhost:3000/posts.xml we should see our RSS feed. If we did a view source we should see something that looks like this:</p>
<pre id="line1"><span class="pi">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
&lt;<span class="start-tag">rss</span><span class="attribute-name"> version</span>=<span class="attribute-value">"2.0"</span>&gt;
 &lt;<span class="start-tag">channel</span>&gt;
  &lt;<span class="start-tag">title</span>&gt;My Mack Blog&lt;/<span class="end-tag">title</span>&gt;
  &lt;<span class="start-tag">link</span>&gt;http://localhost:3000/posts&lt;/<span class="end-tag">link</span>&gt;
  &lt;<span class="start-tag">description</span>&gt;Find out about all the cool stuff happening on my blog!&lt;/<span class="end-tag">description</span>&gt;
  &lt;<span class="start-tag">language</span>&gt;en-us&lt;/<span class="end-tag">language</span>&gt;
  &lt;<span class="start-tag">copyright</span>&gt;Copyright Me&lt;/<span class="end-tag">copyright</span>&gt;</pre>
<pre id="line9">  &lt;<span class="start-tag">pubDate</span>&gt;Tue, 18 Mar 2008 17:18:05 GMT&lt;/<span class="end-tag">pubDate</span>&gt;
  &lt;<span class="start-tag">lastBuildDate</span>&gt;Tue, 18 Mar 2008 17:18:05 GMT&lt;/<span class="end-tag">lastBuildDate</span>&gt;
  &lt;<span class="start-tag">entry</span>&gt;
   &lt;<span class="start-tag">title</span>&gt;My New Post&lt;/<span class="end-tag">title</span>&gt;
   &lt;<span class="start-tag">link</span>&gt;http://localhost:3000/posts/1&lt;/<span class="end-tag">link</span>&gt;
   &lt;<span class="start-tag">description</span>&gt;This is my first post in my cool Mack blog!&lt;/<span class="end-tag">description</span>&gt;</pre>
<pre id="line15">   &lt;<span class="start-tag">pubDate</span>&gt;Tue, 18 Mar 2008 11:58:30&lt;/<span class="end-tag">pubDate</span>&gt;
  &lt;/<span class="end-tag">entry</span>&gt;
 &lt;/<span class="end-tag">channel</span>&gt;
&lt;/<span class="end-tag">rss</span>&gt;</pre>
<p>Awesome! All that&#8217;s really left is create one of those fancy RSS tags in the location field of our browsers that people can click and go straight to the RSS feed. Let&#8217;s do that now.</p>
<p>At the top of your app/views/posts/index.html.erb file add the following:</p>
<pre>&lt;%= rss_tag(posts_index_url(:format =&gt; <img src='http://www.metabates.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml)) %&gt;</pre>
<p>Now, refresh the page in your browser, and there you go, you should now see the little RSS button in the location bar of your browser. If you click that you should be taken to your feed.</p>
<p>That&#8217;s all there is to adding not only xml, but an RSS feed to your new blog.</p>
<p>The code for this demo can be found <a href="http://www.mackframework.com/wp-content/uploads/2008/03/mack_blog_demo.zip" title="Blog Demo w/ XML">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.metabates.com/2008/03/19/adding-rssxml-feeds-to-our-blog-demo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>0.1.0: The Obligatory &#8216;Blog&#8217; Demo</title>
		<link>http://www.metabates.com/2008/03/04/the-obligatory-blog-demo/</link>
		<comments>http://www.metabates.com/2008/03/04/the-obligatory-blog-demo/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 20:15:46 +0000</pubDate>
		<dc:creator>Mark Bates</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[data mapper]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[mack]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[scaffold]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.mackframework.com/2008/03/04/the-obligatory-blog-demo/</guid>
		<description><![CDATA[Ok, because every good framework should tell you how to create a blog, why should Mack be any different? Let&#8217;s start off with the basics. Is Mack installed? If not, here&#8217;s how: $ sudo gem install mack Great! Before we move on, make sure that the gem you installed is at LEAST version 0.1.0, otherwise, [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, because every good framework should tell you how to create a blog, why should Mack be any different? Let&#8217;s start off with the basics. Is Mack installed? If not, here&#8217;s how:</p>
<pre>$ sudo gem install mack</pre>
<p>Great! Before we move on, make sure that the gem you installed is at LEAST version 0.1.0, otherwise, you&#8217;re not going to get very far in this tutorial. Now, let&#8217;s move on. Now let&#8217;s generate our kick ass new blog, and since we&#8217;re going to need some sort of database support for our blog, we&#8217;ll configure it to use DataMapper. If you don&#8217;t have DataMapper installed, please head over to <a href="http://datamapper.org" target="_blank">http://datamapper.org</a> to find out how to install it. Mack has support for ActiveRecord as well, but it&#8217;s just easier to get DataMapper going because you don&#8217;t have to deal with migrations.</p>
<pre>$ mack my_kick_ass_blog -o data_mapper
$ cd my_kick_ass_blog</pre>
<p>That should&#8217;ve created a whole bunch of files and folders for your blog. Now let&#8217;s generate some scaffold code for our blog:</p>
<pre>$ rake generate:scaffold name=posts</pre>
<p>That should&#8217;ve created even more files for you. One of those files is app/models/post.rb, let&#8217;s open that up, so we can edit it for DataMapper.</p>
<p>Edit the file so it looks something like this:</p>
<pre>class Post &lt; DataMapper::Base
  property :title, :string
  property :email, :string
  property :body, :text
  property :created_at, :datetime
  property :updated_at, :datetime

  validates_presence_of :title
  validates_presence_of :body
  validates_presence_of :email
end</pre>
<p>Now, I&#8217;m not going to go into detail as to what that&#8217;s doing, that&#8217;s for the guys at DataMapper to explain. Before we move on to the next step, you&#8217;ll probably want to crack open config/database.yml and edit it so it the paths to your database are correct, you&#8217;ll probably also want to go to your database system and make sure that the database name you configured in your config/database.yml is created, otherwise this will be a very short trip. I&#8217;ll wait while you do that. Finished, great! Let&#8217;s move on.</p>
<p>We need to now open a Mack console so we can create the tables needed for our blog.</p>
<pre>$ rake console
$ Post.table.create!
$ exit</pre>
<p>Ok, we should now have a posts table in our new database. Isn&#8217;t life wonderful? We&#8217;re so close to showing the world how wonderful we are as developers.</p>
<p>Now let&#8217;s edit our views, so they look something like this:</p>
<p>app/views/posts/index.html.erb:</p>
<pre>&lt;h1&gt;Listing posts&lt;/h1&gt;

&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;Title&lt;/th&gt;
    &lt;th&gt;Body&lt;/th&gt;
    &lt;th&gt;Email&lt;/th&gt;
  &lt;/tr&gt;

&lt;% for post in @posts %&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;%=post.title %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%=post.body %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%=post.email %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link_to("Show", posts_show_url(:id =&gt; post.id)) %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link_to("Edit", posts_edit_url(:id =&gt; post.id)) %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link_to("Delete", posts_delete_url(:id =&gt; post.id), :method =&gt; :delete, :confirm =&gt; "Are you sure?") %&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;% end %&gt;
&lt;/table&gt;

&lt;br /&gt;

&lt;%= link_to("New Post", posts_new_url) %&gt;</pre>
<p>app/views/posts/edit.html.erb:</p>
<pre>&lt;h1&gt;Edit post&lt;/h1&gt;

&lt;%= error_messages_for :post %&gt;

&lt;form action="&lt;%= posts_update_url(:id =&gt; @post.id) %&gt;" class="edit_post" id="edit_post" method="post"&gt;
  &lt;input type="hidden" name="_method" value="put"&gt;
  &lt;p&gt;
    &lt;b&gt;Title&lt;/b&gt;&lt;br /&gt;
    &lt;input id="post_title" name="post[title]" size="30" type="text" value="&lt;%= @post.title %&gt;" /&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;b&gt;Body&lt;/b&gt;&lt;br /&gt;
    &lt;textarea id="post_body" name="post[body]"&gt;&lt;%= @post.body %&gt;&lt;/textarea&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;b&gt;Email&lt;/b&gt;&lt;br /&gt;
    &lt;input id="post_email" name="post[email]" size="30" type="text" value="&lt;%= @post.email %&gt;" /&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;input id="post_submit" name="commit" type="submit" value="Create" /&gt;
  &lt;/p&gt;
&lt;/form&gt;

&lt;%= link_to("Back", posts_index_url) %&gt;</pre>
<p>app/views/posts/show.html.erb:</p>
<pre>&lt;p&gt;
  &lt;b&gt;Title:&lt;/b&gt;
  &lt;%= @post.title %&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;b&gt;Body:&lt;/b&gt;
  &lt;%= @post.body %&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;b&gt;Email:&lt;/b&gt;
  &lt;%= @post.email %&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;b&gt;Created at:&lt;/b&gt;
  &lt;%= @post.created_at %&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;b&gt;Updated at:&lt;/b&gt;
  &lt;%= @post.updated_at %&gt;
&lt;/p&gt;

&lt;%= link_to("Edit", posts_edit_url(:id =&gt; @post.id)) %&gt; |
&lt;%= link_to("Back", posts_index_url) %&gt;</pre>
<p>app/views/posts/new.html.erb:</p>
<pre>&lt;h1&gt;New post&lt;/h1&gt;

&lt;%= error_messages_for :post %&gt;

&lt;form action="&lt;%= posts_create_url %&gt;" class="new_post" id="new_post" method="post"&gt;
  &lt;p&gt;
    &lt;b&gt;Title&lt;/b&gt;&lt;br /&gt;
    &lt;input id="post_title" name="post[title]" size="30" type="text" value="&lt;%= @post.title %&gt;" /&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;b&gt;Body&lt;/b&gt;&lt;br /&gt;
    &lt;textarea id="post_body" name="post[body]"&gt;&lt;%= @post.body %&gt;&lt;/textarea&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;b&gt;Email&lt;/b&gt;&lt;br /&gt;
    &lt;input id="post_email" name="post[email]" size="30" type="text" value="&lt;%= @post.email %&gt;" /&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;input id="post_submit" name="commit" type="submit" value="Create" /&gt;
  &lt;/p&gt;
&lt;/form&gt;

&lt;%= link_to("Back", posts_index_url) %&gt;</pre>
<p>Ok, so now we&#8217;ve created our forms, and setup our index page. Let&#8217;s actually go to the site and see it all works!</p>
<p>First we need to start the server:</p>
<p>$ rake server</p>
<p>Now let&#8217;s head on over to http://localhost:3000/posts and see what we&#8217;ve got. You should see a page that looks something like this:</p>
<p><img src="http://www.mackframework.com/wp-content/uploads/2008/03/12.png" alt="Blog Demo 1" /></p>
<p>Now let&#8217;s click on that &#8216;New Post&#8217; link and fill out the form:</p>
<p><img src="http://www.mackframework.com/wp-content/uploads/2008/03/21.png" alt="Blog Demo 2" /></p>
<p>Now, let&#8217;s hit that wonderful &#8216;Create&#8217; button and see what happens!</p>
<p><img src="http://www.mackframework.com/wp-content/uploads/2008/03/31.png" alt="Blog Demo 3" /></p>
<p>Congrats! You just created your first blog post! Now let&#8217;s head back to http://localhost:3000/posts and see what we&#8217;ve got.</p>
<p><img src="http://www.mackframework.com/wp-content/uploads/2008/03/41.png" alt="Blog Demo 4" /></p>
<p>Wonderful! Now all that&#8217;s left to do is to set our home page to our posts index page. Let&#8217;s open up our config/routes.rb and edit the following line:</p>
<pre>r.home_page "/", :controller =&gt; :default, :action =&gt; :index</pre>
<p>so that it&#8217;s now:</p>
<pre>r.home_page "/", :controller =&gt; :posts, :action =&gt; :index</pre>
<p>Now all you have to do is to restart your server and Bob&#8217;s your uncle when you hit http://localhost:3000 again you should your fantastic posts index page.</p>
<p>This concludes our brief introductory tutorial on getting going on Mack. Obviously Mack does a lot more, and I highly encourage you to read the <a href="http://api.mackframework.com">RDoc</a> to find out more about what it can do.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.metabates.com/2008/03/04/the-obligatory-blog-demo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.954 seconds -->

