An "about us" page is not a candidate for a rest resource. You had it
fine before.

If you turned your pages controller into a rest resource and moved the
"about" page into the resulting cms, then you might create a helper
method "about_url" that generates the newly correct url.

If you wanted users to be able to create many "abouts", edit and
destroy them, then you would create an "abouts_controller". The index
action would give a list of abouts (abouts_url would link to it). If
you want to view an individual "about" then about_url(@about). To edit
it, edit_about_url(about). To update it, the form_for(@about) will
take care of the put method. Likewise, link_to "delete about",
about_url(about), :method => :delete will remove it. To create a new
one, new_about_url will get you there.

On Jan 2, 10:17 pm, Rong <ron.gr...@gmail.com> wrote:
> If I created a route like this
> map.about '/about', :controller => 'pages', :action => 'about
>
> And then added this to a different page
> <%= link_to "About", about_url %>
>
> And decided to change my route to
> map.resources :about
>
> the link to no longer works.
>
> What am I doing wrong?

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to