Forum: Ruby on Rails RESTful blog??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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
usual
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 =>
"entry"
  map.archives "/archives", :controller => "content", :action =>
"archives"
  map.categorized "/archives/:category", :controller => "content",
:action
=> "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",
:path_prefix
=> "/admin", :name_prefix => "admin_", :member => {:delete => :delete}
  map.resources :entries, :controller => "admin/entries", :path_prefix
=>
"/admin", :name_prefix => "admin_", :member => {:delete => :delete,
:publish
=> :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,
:publish
=> :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",
:path_prefix
=> "/admin", :name_prefix => "admin_", :member => {:delete => :delete},
:collection => {:search => :get, :email => :get}
  map.admin_settings "/admin/settings", :controller => "admin/settings",
:action => "index"

  map.page "/:url", :controller => "content", :action => "page"
  # Good old catchalls!
  map.catcher "/*path", :controller => "content", :action => "catcher"
end

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

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

http://typo.onxen.info/articles/2006/08/10/ann-res...

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

Sean
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
since
I'm trying to tackle [successfully tackling] multisite blogging/cms. I'm
definitely interested in that code though. Thanks for pointing it out to
me.

RSL
This topic is locked and can not be replied to.