Rails 4: organize rails models in sub path without namespacing models?

By default, Rails doesn’t add subfolders of the models directory to the autoload path. Which is why it can only find namespaced models — the namespace illuminates the subdirectory to look in. To add all subfolders of app/models to the autoload path, add the following to config/application.rb: config.autoload_paths += Dir[Rails.root.join(“app”, “models”, “{*/}”)] Or, if you … Read more

Import module from subfolder

There’s no need to mess with your PYTHONPATH or sys.path here. To properly use absolute imports in a package you should include the “root” packagename as well, e.g.: from dirFoo.dirFoo1.foo1 import Foo1 from dirFoo.dirFoo2.foo2 import Foo2 Or you can use relative imports: from .dirfoo1.foo1 import Foo1 from .dirfoo2.foo2 import Foo2

List all files and directories in a directory + subdirectories

string[] allfiles = Directory.GetFiles(“path/to/dir”, “*.*”, SearchOption.AllDirectories); where *.* is pattern to match files If the Directory is also needed you can go like this: foreach (var file in allfiles){ FileInfo info = new FileInfo(file); // Do something with the Folder or just add them to a list via nameoflist.add(); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)