Wednesday, December 30, 2009

Re: [Rails] Re: Controller named /2010

try a controller named twenty_ten, and:
map.resources :twenty_ten, :as => "2010"

On Wed, Dec 30, 2009 at 12:43 PM, theduz <duzenbury@gmail.com> wrote:


On Dec 30, 11:35 am, Michael Graff <skan.gryp...@gmail.com> wrote:
> Ruby won't let you make a class called 2010Controller, as it is not a
> valid class name.
>
> Why are you being told to create a controller of a specific name?  Is
> it for path reasons?  If so, call it something else (./script/generate
> controller twenty_ten)  and then use a route to set things up from
> /2010/ to what you just made.
>
> --Michael
>
>

Somebody wants the url to be http://example.com/2010/index.html.  They
didn't say why, they just want it.  I originally proposed a redirect
in the web server, but they think they want /2010 in the address bar.

I wondered if a route might be something to investigate, but I'm not
100% clear on how to reroute requests from /2010 to /twenty_ten.  Will
a special route take care that link_to :controller =>
'twenty_ten', :action => 'foo' generates an html link like
http://example.com/2010/foo ?

Thank you.

Regards,
Rich

--

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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.





--
// anything worth taking seriously is worth making fun of
// http://blog.devcaffeine.com/

--

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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate