this is index.html.erb <p> <%= number_to_currency(product.price) %> <%= button_to \'Add to Cart\', cart_items_path(:product_id => product) %>
I have an app which is hosted on Heroku as well as on a VPS. I am using mongodb 开发者_JS百科on this app with mongoid. I want to know what is the correct way to define database connection in mongoid.y
I\'m trying embedded one to one mongoid model where the \"embedded child\" is a pure json input coming from an external API.
I\'ve been tryi开发者_开发问答ng to use Mongoid with Rails on Ubuntu. I have installed mongoDB via apt-get. But when I try to run the rails server, I get this error:
I want to replace url posts/:id with posts/:title in mongo. Is there any way to do it. I tried using key in model
here\'s my model: class Person acts_as_tree end i relate multiple objects as a tree: P1 --- P1.1P1.2 ---
I开发者_运维问答 am new to mongo/mongoid and I am trying to setup a self referencing relationships on my sites table.
I have Thing model which has an array of topics and followings. I want to find all things that the current_user following its Topic or its \'User\'.
I have the following model: class Bill . . . some fields . . . belongs_to :sponsor, :class_name => \"Legislator\"
I am a little stuck here (mongoid docs does not seem to give an answer) Question.where(:text.contains=>\"perfect\")