Hello, i have another question about overriding Rails conventions.
Is it possible to tell Rails which model/controller is defined in which
file?
I have generated a model and a controller as follows:
$ rails generate model KnownIP ...
...
$ rails generate controller KnownIPs ...
The problem is with the "IP" in the name: now i have a model *KnownIp*
in the file *known_ip.rb* and a controller *KnownIPsController* in the
file *known_i_ps_controller.rb*, which does not look consistent.
The model can be renamed without problems to KnownIP.
However, if the controller file is renamed to known_ips_controller.rb it
(most likely) will stop working (i tested such situation with models,
but
not with controllers).
Another interesting example: if a model is generated with
$ rails generate model known_i_p ...
then it is broken from the beginning.
To make it work, it is necessary to rename its file from *known_i_p.rb*
to
*known_ip.rb*, and to add
set_table_name 'known_i_ps'
to it.
Can the correspondence between file names and model names be specified
manually in such odd cases?
Alexey.
--
Posted via http://www.ruby-forum.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.
No comments:
Post a Comment