Forum: Ruby on Rails RESTful blog??

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Russell N. (Guest)
on 2007-01-09 16:13
(Received via mailing list)
I'm curious if anyone has a better, more RESTful implementation of the
blog/CMS methodology. I use REST for my admin controllers but
I'm not really sure if I'm actually exposing the record/resource or an
interpretation of it [as the front page does].

Here's a quick mockup of what I've been using in routes.rb

ActionController::Routing::Routes.draw do |map|
  # Content URLs
  map.index "/", :controller => "content", :action => "index"
  map.oops "/oops", :controller => "content", :action => "oops" # The
catcher_url redirects here as a 404, kinda.
  map.entry "/entry/:id/:title", :controller => "content", :action =>
  map.archives "/archives", :controller => "content", :action =>
  map.categorized "/archives/:category", :controller => "content",
=> "categorized"
  # The page route needs to be just before the catchall so it doesn't
try to
handle the admin pages.

  # Admin URLs
  map.admin "/admin", :controller => "admin/common", :action => "index"
  map.resources :categories, :controller => "admin/categories",
=> "/admin", :name_prefix => "admin_", :member => {:delete => :delete}
  map.resources :entries, :controller => "admin/entries", :path_prefix
"/admin", :name_prefix => "admin_", :member => {:delete => :delete,
=> :post, :detach => :delete, :detag => :delete}, :collection =>
{:search =>
:get, :categorized => :get}
  map.resources :pages, :controller => "admin/pages", :path_prefix =>
"/admin", :name_prefix => "admin_", :member => {:delete => :delete,
=> :post, :detach => :delete}, :collection => {:search => :get}
  map.resources :users, :controller => "admin/users", :path_prefix =>
"/admin", :name_prefix => "admin_"
  map.resources :sessions, :controller => "admin/session", :path_prefix
"/admin", :name_prefix => "admin_", :collection => {:delete => :delete}
  map.resources :addresses, :controller => "admin/addresses",
=> "/admin", :name_prefix => "admin_", :member => {:delete => :delete},
:collection => {:search => :get, :email => :get}
  map.admin_settings "/admin/settings", :controller => "admin/settings",
:action => "index" "/:url", :controller => "content", :action => "page"
  # Good old catchalls!
  map.catcher "/*path", :controller => "content", :action => "catcher"

Should I somehow be including the content URLs in on the REST goodness?
me, they're two different apps kinda. The RESTful admin app and the
reader one. Is this crazy though?

Sean H. (Guest)
on 2007-01-10 00:11
(Received via mailing list)
You might be able to get some insight from this example:

The article is from August, but the source seems to be actively updated.

Russell N. (Guest)
on 2007-01-10 00:38
(Received via mailing list)
Well, blow me down. That is some completely RESTful blogness there. I
feel a
little more comfortable in the way I'm doing things now. Especially
I'm trying to tackle [successfully tackling] multisite blogging/cms. I'm
definitely interested in that code though. Thanks for pointing it out to

This topic is locked and can not be replied to.