creating a model with name “import” is it reserved word in rails 3?
-
14-07-2021 - |
Question
having all kind of strange stuff happening with a model and form named "import" is this a reserved word in rails somehow? I could not find it in some old webposts on reserved words in rails.
EDIT: Some code example to Illustrate, seem to be unable to pinpoint the problem
Works:
- @profile = Profile.new
= form_for @profile, :method => :get, :html => { :class => 'form-horizontal' } do |f|
throws error # embed raw
Fails:
- @import = Import.new
= form_for @import, :method => :get, :html => { :class => 'form-horizontal' } do |f|
With error:
undefined method `imports_path' for #<#<Class:0x007fe4e0369468>:0x007fe4e25410e0>
Solution 2
Solved it was incorrect naming of controller import model that caused this, I missed the S char in the filename
OTHER TIPS
To my knowledge, import
is not a reserved word in Ruby.
It is much more likely an issue with your specific codebase.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow