0
votes
1answer
9 views

undefined method `paginate' for Array on Rails 3 with mongoid

Trying to use will_paginate gem. My Gem file has: gem 'will_paginate', '~> 3.0.0' My orders_controllers.rb: def index @orders = Order.all.paginate(:page => params[:page], :per_page ...
0
votes
2answers
35 views

accessing mongodb document field names and its values through iteration

Let's say I have a mongodb document in the products collection: { "_id" : ObjectId("51b1eac0311b6dd93a000001"), "name" : "Apple", "price" : "34.45" } products_controller.rb for def show ...
0
votes
1answer
17 views

Rails app with Mongoid not saving on update

I'm making a Rails app that uses Mongoid and devise. Currently, the functionality's pretty basic, but it's not working like I expect it to. In particular, update isn't working at all. I can create a ...
0
votes
1answer
39 views

importing simplified XML file into mongodb using crack gem

Here, I'm using mongodb driver for ruby. But after this will work perfect I want to run it as a scheduled task in Ruby on Rails 3 with Mongoid ODB. So for now, I'm experimenting in ruby. I've ...
1
vote
0answers
36 views

Searching within embedded documents array field

I have a User model that has embedded inside it many items. The Items model has a field titled category that is assigned as an array. I want to be able to return a list of users that that have items ...
0
votes
1answer
12 views

Implementing difficult model relations in Mongoid

Can't implement provided scheme in mongoid without has_ through: User has many posts and belongs to many projects, and, depending on the participation in some projects, belongs to some sections, can ...
0
votes
2answers
19 views

embeds_many with condition?

How can I do an embeds_many if a field is of a specific value? For example. Lets assume a member of the family can have one or many cars if they are older than or equal to 18 years of age. class ...
0
votes
1answer
34 views

Saving records recursively with Mongoid, Ancestry

I have a model Line Items embedded in Line model. In Line create view, I have provided ability to define multiple nested levels of line items. Here is a random snap of param[:line]: => ...
0
votes
1answer
50 views

Slow Mongo queries from Rails app taking > 1000 ms … ideas for optimization?

We built a Rails app on Mongo 2.2 and Rails 3.2.12. We're new to Mongo and would appreciate any tips on how we should optimize very slow queries, ones that take longer than 1000 ms. We're using ...
0
votes
1answer
26 views

polymorphic association with formtastic and mongo

I'm trying to create a relationship between two models in rails. I have a Product and an Offer where an Offer belongs to a Product. class Product include Mongoid::Document include ...
1
vote
1answer
44 views

Rails database name dynamically by user choice in Mongodb

While installing my app , I want to ask question like Name of database? and user will input name they want for database. Database name is inside config/mongoid.yml development: sessions: ...
0
votes
2answers
30 views

Benefit of $snapshot with Mongo? Is it okay to disable by default?

This Mongo page explains what the $snapshop command does, but can someone explain why this would be helpful, or whether it's wise to disable by default? We're using MongoMapper on Rails 3.2.12, and ...
0
votes
2answers
48 views

How to create relations among models for a rails app with devise and mongoid?

I'm trying to create a simple to-do list app here.. Is there any tutorial which can guide me to create relations among models? and what changes are nedded for the task controller.. Ruby - 1.9.3-p385 ...
0
votes
1answer
60 views

Rails/Mongoid: Can an embedded (embedded_in) document have many documents (has_many)?

I have a user who embeds many email_accounts. At the same time I wish that the email_accounts can have many email_templates. Is this possible? My Rails app refuses to accept the relations when I try ...
0
votes
0answers
18 views

Moingoid - retrieving all embedded documents from parents with the same name

I am relatively new to Mongo and using it in my first project. As the requirements of the project have changed, I'm trying to determine if Mongo is still a good fit given some of the new things I'm ...

1 2 3 4 5 29
15 30 50 per page