Forum: Ruby on Rails Help controller

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.
Michael G. (Guest)
on 2009-02-17 19:58
(Received via mailing list)
Yes, I know the irony of asking for help with a help controller.  :)

The intent here is to have a place to put common help messages,
nothing complicated at the beginning at least.  I created a help
controller, but of course the rspec_scaffold generator called it, and
the path generated, 'helps'.  I tend to think /helps/... is a path
that might indicate we need a better translator, so I added this to my
routes.rb file:

  map.resources :help

This seems to have taken care of most of it.  Since right now all the
terms come from an internal, non-database-backed array, I have no need
(currently) for the other methods, so I added :only => [:index, :show]
to this.  However, I also want an entry page which doesn't just list
all possible status codes, I added :collection => { :all => :get } as
well.

Now, this works, but it was a lot of manual renaming of files.

The question is, what are others doing for this sort of thing?  /helps
just seems so... wrong, but everything behind it would be RESTful.
/help/ won't map into certain paradigms of automatic resource mapping,
but I like it better for the user to see on the screen.

Thanks,
--Michael
Rick (Guest)
on 2009-02-18 04:21
(Received via mailing list)
Pick a name that pluralizes nicely, for example:

generate rspec_scaffold HelpScreen key:string content:text

You can also edit config/initializers/inflections.rb to specify your
singular / plural rule but understand that help / help won't work
without the manual munching you've been doing.
This topic is locked and can not be replied to.