Topic: Case problem

I created a controller called "DVD", but the URLs in the browser show up as "dvd".  And I can't access the controller actions unless I manually change it to DVD in the address bar.

I'm making a simple DVD database of the DVDs I own.  I have actions which I can show/add/edit/delete and the links to those pages are generated by Rails, but it lowercases the controller.

Example:

I type "www.domain.com/DVD/" into my browser's address bar and it works.  It shows me a list of all the DVDs.  I can click on a DVD if I wish to see more information about it. If I click on the DVD, the URL becomes "www.domain.com/dvd/show?id=4587" and that results in an error.  I have to manually change the URL to "www.domain.com/DVD/show?id=4587" to make it work.  How do I make it so that Rails doesn't screw up the letter-case?

Re: Case problem

If you rename your controller to DvdController and always use lowercase in the URL it should work. I know it's not ideal, but that's the only way I know of off the top of my head.

Railscasts - Free Ruby on Rails Screencasts

Re: Case problem

How do I rename the controller?  Do I just go and rename the files or is there a special command I have to run?

Re: Case problem

The files should already be lowercase - if they aren't, make them lowercase.

All you need to change is the name of the controller in the dvd_controller.rb file, the dvd_helper.rb file, and the test files if you are doing testing. I don't think there's anywhere else you'll need to change the name.

Railscasts - Free Ruby on Rails Screencasts

Re: Case problem

Thanks, that's all I had to do.  It works now. smile