“Routing Error uninitialized constant” error

I've gone through a number of the causes of this problem but I think that this issue is related to the names I've given my resources. Here's the command I'm running.

rails generate scaffold_controller iform__c content__c:String header__c:String

But when I navigate to:

http://localhost:3000/iform__cs

I get the following error:

Routing Error

uninitialized constant Iform_csController

I've raked the DB, the files all exist so I'm very confused. I've tried exactly the same rails g command for a resource named "account" and it seems to work perfectly.

Would love to know if anyone can explain why I'm getting this error.

Answers


Rails uses a bunch of conventions to make things work smoothly. You're breaking pretty much every single one with this naming scheme.

If it's a legacy database you're having to deal with, I suggest using updateable VIEWs to bring the column and table names in line with Rails' expectations.

If it's a legacy URL scheme you're having to deal with, consider creating a clean structure within Rails, and rewrite legacy URLs to the new-style ones with nginx rewrite rules.

(If you're unwilling to do either, Rails may not be the software for you. Zend Framework may provide you with the capability to service tangled Enterprise application structures more easily.)


Need Your Help

how to change stored procedure into table valued function?

sql sql-server stored-procedures

This is my stored procedure that I want to change into a table-valued function. I don't know how to create a table-valued function, please help me

Parse.com data migration (hypothetical)

parse.com

Say I am developing an app that needs a backend, so I choose parse because I do not have the capacity to write a truly great backend myself.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.