<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://wiki.merbivore.com/lib/exe/css.php?s=feed" type="text/css"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Merb Wiki howto</title>
    <subtitle></subtitle>
    <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/"/>
    <id>http://wiki.merbivore.com/</id>
    <updated>2010-08-19T18:27:39-07:00</updated>
    <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
<link rel="self" type="application/atom+xml" href="http://wiki.merbivore.com/feed.php" />
    <entry>
        <title>Merb Authentication</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/auth?rev=1266159990&amp;do=diff"/>
        <published>2010-02-14T07:06:30-07:00</published>
        <updated>2010-02-14T07:06:30-07:00</updated>
        <id>http://wiki.merbivore.com/howto/auth?rev=1266159990&amp;do=diff</id>
        <summary>Merb Authentication

MerbAuth examples:

	*  Authenticated Hello World
	*  Example app showing how to test an authenticated route
	*  Example of how to set up authentication with couchdb and couchrest</summary>
    </entry>
    <entry>
        <title>howto:cache</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/cache?rev=1227569010&amp;do=diff"/>
        <published>2008-11-24T15:23:30-07:00</published>
        <updated>2008-11-24T15:23:30-07:00</updated>
        <id>http://wiki.merbivore.com/howto/cache?rev=1227569010&amp;do=diff</id>
        <summary>See also: merb-cache plugin</summary>
    </entry>
    <entry>
        <title>Cookies!</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/cookies?rev=1226656401&amp;do=diff"/>
        <published>2008-11-14T01:53:21-07:00</published>
        <updated>2008-11-14T01:53:21-07:00</updated>
        <id>http://wiki.merbivore.com/howto/cookies?rev=1226656401&amp;do=diff</id>
        <summary>There may come a point in your life when you want to start putting aside a few cookies now and then for times of need.  Unless you interpret “cookies” as a metaphor for money, Merb can help you!

Handling cookies in Merb is super easy; however, there's a simple method and a more comprehensive method for doing so.  Fear not, they're explained in their entirety here.</summary>
    </entry>
    <entry>
        <title>CRUD view examples</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb?rev=1228760818&amp;do=diff"/>
        <published>2008-12-08T10:26:58-07:00</published>
        <updated>2008-12-08T10:26:58-07:00</updated>
        <id>http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb?rev=1228760818&amp;do=diff</id>
        <summary>CRUD view examples


CRUD stands for Create Read Update Delete. Often, web developers decide to follow this principle and create a few views matching the following actions: 


	*  New (to collect the data to create)
	*  Create (to actually create an object, no views required: if the creation worked, the user gets redirected, otherwise the new action gets re-rendered)</summary>
    </entry>
    <entry>
        <title>Database Support HOWTOs</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/database?rev=1224349639&amp;do=diff"/>
        <published>2008-10-18T10:07:19-07:00</published>
        <updated>2008-10-18T10:07:19-07:00</updated>
        <id>http://wiki.merbivore.com/howto/database?rev=1224349639&amp;do=diff</id>
        <summary>*  Selecting an ORM

DataMapper Howtos


Howtos specific to DataMapper.


	*  Migrations

CouchDB


CouchDB is a document oriented database that doesn’t impose the constraints of schemas and fixed size fields on your data. It's a natural fit for semi-structured data, and hence, many web apps.</summary>
    </entry>
    <entry>
        <title>Debugging HowTos</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/debugging?rev=1224606585&amp;do=diff"/>
        <published>2008-10-21T09:29:45-07:00</published>
        <updated>2008-10-21T09:29:45-07:00</updated>
        <id>http://wiki.merbivore.com/howto/debugging?rev=1224606585&amp;do=diff</id>
        <summary>Getting Started


Merb uses ruby-debug (“rdebug”).  Odds are good you have it installed already, but if not...

&gt; gem install ruby-debug

To launch merb with ruby-debug enabled add the ”-D” flag:

&gt; merb -D
Hint: If you spend more than a couple minutes using rdebug, you'll want to set up a ~/.rdebugrc file that looks something like this :</summary>
    </entry>
    <entry>
        <title>Dependencies - Require but Awesome</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/dependencies?rev=1227946189&amp;do=diff"/>
        <published>2008-11-29T00:09:49-07:00</published>
        <updated>2008-11-29T00:09:49-07:00</updated>
        <id>http://wiki.merbivore.com/howto/dependencies?rev=1227946189&amp;do=diff</id>
        <summary>If you are requiring a gem that is named differently than the name of the library (like from a Github account) then you need to pass the correct name into require_as:


dependency(&quot;notch8-webrat&quot;, :require_as =&gt; 'webrat')
dependency 'rest-client', :require_as =&gt; 'rest_client'</summary>
    </entry>
    <entry>
        <title>Deployment HOWTOs</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/deployment?rev=1229797612&amp;do=diff"/>
        <published>2008-12-20T10:26:52-07:00</published>
        <updated>2008-12-20T10:26:52-07:00</updated>
        <id>http://wiki.merbivore.com/howto/deployment?rev=1229797612&amp;do=diff</id>
        <summary>*  Bundling a Merb application
	*  Deploying a Merb application
	*  Deploying on JRuby
	*  Deploying with Passenger
	*  Deploying with HAProxy
	*  Merb on Slicehost:
		*  Part 1: Users and Permissions
		*  Part 2: Install Software
		*  Part 3: Version and Deploy</summary>
    </entry>
    <entry>
        <title>Application Development HOWTOs</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/development?rev=1226678265&amp;do=diff"/>
        <published>2008-11-14T07:57:45-07:00</published>
        <updated>2008-11-14T07:57:45-07:00</updated>
        <id>http://wiki.merbivore.com/howto/development?rev=1226678265&amp;do=diff</id>
        <summary>*  Generating a new Merb app
	*  CRUD view examples
	*  Merb Router
	*  Sending emails from a Merb app
	*  Handling Exceptions
	*  Quickstart for Rails Users
	*  Serving static content
	*  Use the resource url helpers
	*  Rails-style &quot;flash&quot; messages</summary>
    </entry>
    <entry>
        <title>Installation HOWTOs</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/installation?rev=1227394252&amp;do=diff"/>
        <published>2008-11-22T14:50:52-07:00</published>
        <updated>2008-11-22T14:50:52-07:00</updated>
        <id>http://wiki.merbivore.com/howto/installation?rev=1227394252&amp;do=diff</id>
        <summary>*  Installing Merb from gems (recommended)
	*  Installing Merb from edge

Do I want gems or edge?


“edge” is what most people refer to as “trunk” in the svn world.  It represents the cutting edge of the source.  As such, most people don't actually need it.</summary>
    </entry>
    <entry>
        <title>Mailers</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/mailers?rev=1270753891&amp;do=diff"/>
        <published>2010-04-08T12:11:31-07:00</published>
        <updated>2010-04-08T12:11:31-07:00</updated>
        <id>http://wiki.merbivore.com/howto/mailers?rev=1270753891&amp;do=diff</id>
        <summary>A plugin for the Merb framework that allows you to send email from Merb application. It separates email composition and sending into micro MVC: you may have mail controllers that compose complex emails, emails have their own views and models (models use MailFactory library and are non-persistable).</summary>
    </entry>
    <entry>
        <title>Models in Merb</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/models?rev=1227847865&amp;do=diff"/>
        <published>2008-11-27T20:51:05-07:00</published>
        <updated>2008-11-27T20:51:05-07:00</updated>
        <id>http://wiki.merbivore.com/howto/models?rev=1227847865&amp;do=diff</id>
        <summary>Datamapper


You can find a quick overview of DataMapper features below, but you should check out the DataMapper documentation for more in-depth information. 

Properties


When defining a model in Datamapper you specify the properties in the model file.  This is handy when you want to see what the column was that has all of your headline content in it.  The basic syntax is this...</summary>
    </entry>
    <entry>
        <title>What is the Model-View-Controller architectural pattern?</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/mvc?rev=1227411226&amp;do=diff"/>
        <published>2008-11-22T19:33:46-07:00</published>
        <updated>2008-11-22T19:33:46-07:00</updated>
        <id>http://wiki.merbivore.com/howto/mvc?rev=1227411226&amp;do=diff</id>
        <summary>The MVC architectural pattern is the notion of abstracting your application into three layers:

	*  The View layer presents the data to the user.  This is the only layer that actually generates markup that is outputted to the user's browser.  In Merb, you have two options for templating engines: eRuby and Haml.  Which you choose depends on personal preference and application.
	*  The Model layer embodies objects that the user is interacting with.  Posts, Articles, even Users (in authentication) …</summary>
    </entry>
    <entry>
        <title>Parts</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/parts?rev=1233272307&amp;do=diff"/>
        <published>2009-01-29T15:38:27-07:00</published>
        <updated>2009-01-29T15:38:27-07:00</updated>
        <id>http://wiki.merbivore.com/howto/parts?rev=1233272307&amp;do=diff</id>
        <summary>Parts in merb are just like small controllers that you can use to perform logic.
One very good usage for them is when you want add a “widget” to a view, that 
has its own logic.

We'll look at an example on how to make a part that, displays the news titles.</summary>
    </entry>
    <entry>
        <title>About Merb Plugins</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/plugins?rev=1226711365&amp;do=diff"/>
        <published>2008-11-14T17:09:25-07:00</published>
        <updated>2008-11-14T17:09:25-07:00</updated>
        <id>http://wiki.merbivore.com/howto/plugins?rev=1226711365&amp;do=diff</id>
        <summary>About Merb Plugins


Merb plugins are distributed as gems, which makes for easy versioning and management. Your merb plugin gems can be installed either on a per-application basis, or for an entire system. The following sections will outline how to get started with plugins.</summary>
    </entry>
    <entry>
        <title>Intro</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/requests?rev=1232481142&amp;do=diff"/>
        <published>2009-01-20T11:52:22-07:00</published>
        <updated>2009-01-20T11:52:22-07:00</updated>
        <id>http://wiki.merbivore.com/howto/requests?rev=1232481142&amp;do=diff</id>
        <summary>Have a request for a HowTo that's not up yet?  Create a link to the non-existent HowTo on the main wiki page and add your request below.  If the HowTo you want is already on this page, feel free to add a * after it to ”+1” it.


	*  Example HowTo Request *</summary>
    </entry>
    <entry>
        <title>The Router</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/router?rev=1233401844&amp;do=diff"/>
        <published>2009-01-31T03:37:24-07:00</published>
        <updated>2009-01-31T03:37:24-07:00</updated>
        <id>http://wiki.merbivore.com/howto/router?rev=1233401844&amp;do=diff</id>
        <summary>All routes are defined in the “router.rb” file which is in your config directory.  The router uses restful routing which makes several helper urls for common operations.  


General Matcher

To attach a path to a specific action/controller pair you use the match.to methods</summary>
    </entry>
    <entry>
        <title>Delete action view example with jquery confirmation</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/simple_delete_view?rev=1239147607&amp;do=diff"/>
        <published>2009-04-07T16:40:07-07:00</published>
        <updated>2009-04-07T16:40:07-07:00</updated>
        <id>http://wiki.merbivore.com/howto/simple_delete_view?rev=1239147607&amp;do=diff</id>
        <summary>Delete action view example with jquery confirmation

This should really be the destroy action. Delete action is more like new and edit action. So should be more like the following down below:



  def delete(id)
    only_provides :html
    @article = Article.get(id)
    raise NotFound unless @article
    display @article
  end
  
  def destroy(id)
    @article = Article.get(id)
    raise NotFound unless @article
    if @article.destroy
      redirect resource(:articles)
    else
      raise Inte…</summary>
    </entry>
    <entry>
        <title>howto:simple_edit_form</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/simple_edit_form?rev=1225671704&amp;do=diff"/>
        <published>2008-11-02T16:21:44-07:00</published>
        <updated>2008-11-02T16:21:44-07:00</updated>
        <id>http://wiki.merbivore.com/howto/simple_edit_form?rev=1225671704&amp;do=diff</id>
        <summary>Note how the form helper ends by &lt;% end =%&gt;  You might get in trouble if you miss that.



&lt;h1&gt;Article controller, edit action&lt;/h1&gt;


&lt;%= form_for(@article, :action =&gt; resource(@article)) do %&gt;

  &lt;p&gt;
    &lt;%= text_field :title, :label =&gt; &quot;Title&quot;  %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;%= text_field :author, :label =&gt; &quot;Author&quot;  %&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;%= submit &quot;Update&quot; %&gt;
  &lt;/p&gt;
&lt;% end =%&gt;

&lt;%= link_to 'Show', resource(@article) %&gt; | &lt;%= link_to 'Back', resource(:articles) %&gt;</summary>
    </entry>
    <entry>
        <title>Index action view example</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/simple_index_view?rev=1224474606&amp;do=diff"/>
        <published>2008-10-19T20:50:06-07:00</published>
        <updated>2008-10-19T20:50:06-07:00</updated>
        <id>http://wiki.merbivore.com/howto/simple_index_view?rev=1224474606&amp;do=diff</id>
        <summary>Index action view example


&lt;h1&gt;Article controller, index action&lt;/h1&gt;

&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;Title&lt;/th&gt;
    &lt;th&gt;Author&lt;/th&gt;

    &lt;th colspan=&quot;3&quot;&gt;Actions&lt;/th&gt;
  &lt;/tr&gt;

&lt;% @articles.each do |article| %&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;%=h article.title %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%=h article.author %&gt;&lt;/td&gt;

    &lt;td&gt;&lt;%= link_to 'Show', resource(article) %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link_to 'Edit', resource(article, :edit) %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= delete_button(article, &quot;Delete #{article.title}&quot;) %&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;% end %&gt;
&lt;/table&gt;

&lt;%= li…</summary>
    </entry>
    <entry>
        <title>New action view example</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/simple_new_view?rev=1231698289&amp;do=diff"/>
        <published>2009-01-11T10:24:49-07:00</published>
        <updated>2009-01-11T10:24:49-07:00</updated>
        <id>http://wiki.merbivore.com/howto/simple_new_view?rev=1231698289&amp;do=diff</id>
        <summary>New action view example


&lt;h1&gt;Article controller, new action&lt;/h1&gt;

&lt;%= form_for(@article, :action =&gt; resource(:articles) ) do %&gt;

  &lt;p&gt;
    &lt;%= text_field :title, :label =&gt; &quot;Title &quot; %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;%= text_field :content, :label =&gt; &quot;Content &quot;  %&gt;
  &lt;/p&gt;

  &lt;p&gt;
    &lt;%= submit &quot;Create&quot; %&gt;
  &lt;/p&gt;
&lt;% end =%&gt;

&lt;%= link_to 'Back', resource(:articles) %&gt;</summary>
    </entry>
    <entry>
        <title>Show action view example</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/simple_show_view?rev=1225180004&amp;do=diff"/>
        <published>2008-10-28T00:46:44-07:00</published>
        <updated>2008-10-28T00:46:44-07:00</updated>
        <id>http://wiki.merbivore.com/howto/simple_show_view?rev=1225180004&amp;do=diff</id>
        <summary>Show action view example


&lt;h1&gt;Article controller, show action&lt;/h1&gt;

&lt;h3&gt;&lt;%=h @article.title %&gt;&lt;/h3&gt;
&lt;b&gt;by: &lt;%=h @article.author %&gt;&lt;/b&gt;

&lt;p&gt;
  &lt;%=h @article.body %&gt;
&lt;/p&gt;

&lt;%= link_to 'Back', resource(:articles) %&gt;</summary>
    </entry>
    <entry>
        <title>How to Quickstart Merb Slice Development</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/slice?rev=1234186353&amp;do=diff"/>
        <published>2009-02-09T05:32:33-07:00</published>
        <updated>2009-02-09T05:32:33-07:00</updated>
        <id>http://wiki.merbivore.com/howto/slice?rev=1234186353&amp;do=diff</id>
        <summary>What are Merb Slices?

Merb Slices are a kind of mini Merb Application that can be packaged up as gems and used as is (or with customizations) within actual Merb Applications. They are full Model-View-Controller stacks to support a large feature within a larger application. Examples could be a full blogging system, user management system or a file upload system.</summary>
    </entry>
    <entry>
        <title>howto:start</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/start?rev=1223704684&amp;do=diff"/>
        <published>2008-10-10T22:58:04-07:00</published>
        <updated>2008-10-10T22:58:04-07:00</updated>
        <id>http://wiki.merbivore.com/howto/start?rev=1223704684&amp;do=diff</id>
    </entry>
    <entry>
        <title>Testing HOWTOs</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/testing?rev=1227840873&amp;do=diff"/>
        <published>2008-11-27T18:54:33-07:00</published>
        <updated>2008-11-27T18:54:33-07:00</updated>
        <id>http://wiki.merbivore.com/howto/testing?rev=1227840873&amp;do=diff</id>
        <summary>*  Testing the full stack with request specs
	*  Testing a Merb app with Rspec
	*  Testing transactional specs with DataMapper
	*  View matchers
	*  Using Cucumber/Webrat with Merb
	*  Tips &amp; Tricks
		*  DataMapper</summary>
    </entry>
    <entry>
        <title>Troubleshooting HOWTOs</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/troubleshooting?rev=1223704790&amp;do=diff"/>
        <published>2008-10-10T22:59:50-07:00</published>
        <updated>2008-10-10T22:59:50-07:00</updated>
        <id>http://wiki.merbivore.com/howto/troubleshooting?rev=1223704790&amp;do=diff</id>
        <summary>*  Common Exceptions</summary>
    </entry>
    <entry>
        <title>Using Cucumber/Webrat with Merb</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/using_webrat_with_merb?rev=1233887104&amp;do=diff"/>
        <published>2009-02-05T18:25:04-07:00</published>
        <updated>2009-02-05T18:25:04-07:00</updated>
        <id>http://wiki.merbivore.com/howto/using_webrat_with_merb?rev=1233887104&amp;do=diff</id>
        <summary>Guide on getting up and running with Cucumber + Webrat on Merb: 

	*  &lt;http://teamon.eu/2008/12/02/merb-cucumber-webrat-czyli-wszystko-co-chcielibyscie-wiedzie/&gt;


attach_file support in Webrat for Merb can be found in the auxesis-webrat gem: 

	*  &lt;http://github.com/auxesis/webrat/tree/master&gt;</summary>
    </entry>
    <entry>
        <title>Notes on Very Flat Apps:</title>
        <link rel="alternate" type="text/html" href="http://wiki.merbivore.com/howto/very_flat?rev=1231924576&amp;do=diff"/>
        <published>2009-01-14T01:16:16-07:00</published>
        <updated>2009-01-14T01:16:16-07:00</updated>
        <id>http://wiki.merbivore.com/howto/very_flat?rev=1231924576&amp;do=diff</id>
        <summary>*  to have the app reload itself while in development mode, add this to your file: 

Merb.push_path(:application,  __FILE__)

	*  to have the app reload itself only when the file is modified, try this:

Merb.push_path(:lib,  File.dirname(__FILE__), File.basename(__FILE__))</summary>
    </entry>
</feed>
