views:

38

answers:

1

Hello, I wanted to create some basic html pages to add to my rails app.

I figured the restful way to do it would be to create a controller. The problem is I'd like the pages to be a two word title. => ex. www.mydomain.com/foo-bar/

For SEO reasons it really must be two words, and I need the separation...using www.mydomain.com/foobar/ would be a last resort

The problem is I cant "script/generate controller foo-bar" because the of the dash.

Is there any kind of workaround for this?

+2  A: 

Does an underscore work for you? You can simply:

$ script/generate controller foo_bar

Your controller class name will be FooBarController, and the default route would map it to something like http://www.example.com/foo_bar/abc....

Shtééf
thanks that made it the controller.... but whenever I try to go to www.mydomain.com/foo_bar...I get the the routing error page where theres "No route matches "/foo_bar" with {:method=>:get}"
ChrisWesAllen
oh ok i figured it out....just need to add the map.connect to the routes
ChrisWesAllen