1

I have a bunch of functions in my controller that help me access Neo4j through the Neography::Rest function but I want to move it into its own class.

Where can I put it so I can call Neo.blabla inside any controller like a Model? I tried to put it with the Models but it does not find the class. There should be an easy solution that loads one instance of that class so in my application I can access the Rest connection from any controller. I am quite sure putting the @neo inside the controller is not how one is supposed to do it.

My neo4j graph is too complicated to use the Neo4j ActiveNode stuff. It really wouldn't help me. I just need the Neography REST access and access my own wrapper on top of that.

samst
  • 536
  • 7
  • 19
  • What path are you using and what does your model (roughly) look like? Rails should autoload files from the `app/models` directory as long as the file and class are named correctly. – Brian Underwood May 17 '15 at 10:08
  • Also, I'm one of the maintainers of the `neo4j` gem and I'd be curious to know why your model is too complicated for `ActiveNode`. My feeling is that `ActiveNode` is better when your domain is more complicated. We'd love your feedback! Also, feel free to drop by our chat room if that's easier: https://gitter.im/neo4jrb/neo4j – Brian Underwood May 17 '15 at 10:09

0 Answers0