Questions tagged [money-rails]

money-rails provides integration of the money gem with Ruby on Rails.

money-rails provides integration of the money gem with Ruby on Rails.

Both ActiveRecord and Mongoid are now supported.

For more information: https://github.com/RubyMoney/money-rails

86 questions
0
votes
1 answer

Rails - Simple Form - Money-Rails gem - show selection on edit

I am trying to make an app in rails 4, using simple form and money-rails. I have attributes in my model that are monetised. When I create a new form and save attributes, I want those saved inputs to display when I come back and edit the form. At the…
Mel
  • 2,481
  • 26
  • 113
  • 273
0
votes
1 answer

Using money-rails minidollars unit instead of cents

By default, money save value in cents and create migration like price_cents:integer. I need to save and calculate values in minidollars (1/1000 of currency). I don't register currencies myself. I use gem google_currency for getting current currency…
0
votes
1 answer

Money-Rails Gem - displaying humanised money with symbol

Im trying to use Money-Rails with my Rails 4 app. I have a participants model which has attributes as follows: t.boolean "costs" t.integer "participation_cost_pennies", default: 0, null: false t.string "participation_cost_currency",…
Mel
  • 2,481
  • 26
  • 113
  • 273
0
votes
2 answers

Rails money - create database column without currency default

Can I use the t.money migration helper to create a column without a default currency? create_table :product do |t| t.money :price end creates: t.string "price_currency", default: "ZWL", null: false but would like: t.string …
Brian Low
  • 11,605
  • 4
  • 58
  • 63
0
votes
1 answer

Money-Rails Gem and Instance Currencies

I am trying to use the money-rails gem in my rails 4 app. I have a participant model which has attributes for each of currency and participation_cost in it. My objective is for users to specify a currency for each instance, and an amount of the cost…
Mel
  • 2,481
  • 26
  • 113
  • 273
0
votes
1 answer

initialize method in the money gem

I am reading the money gem source code and I can't seem to understand the constructor: def initialize(obj, currency = Money.default_currency, bank = Money.default_bank) @fractional = obj.respond_to?(:fractional) ? obj.fractional : as_d(obj) …
Ahmad Al-kheat
  • 1,805
  • 2
  • 16
  • 25
0
votes
0 answers

money-rails monetize :price_cents doesn't return money object for price

I have an active record model called Record (representing a physical vinyl record) and I'm trying to make use of money/rails which uses rubymoney/monetize I've followed the instructions in money/rails which tells me to utilize a model class method…
0
votes
1 answer

Model with money-rails testing using RSpec new syntax

New to Ruby on Rails here. I'm doing an application with money support using money-rails gem. I want to test the money locale. Reading the gem's example at test_helpers_spec.rb, there is let(:product) do Product.create(:price_cents => 3000,…
paulochf
  • 690
  • 2
  • 11
  • 21
0
votes
0 answers

How can i use indian rupee symbol in sublime text 2 editor in ubuntu 12.04LTS?

I want to use indian rupee symbol in my sublime text editor 2. I have googled for more than 4 hours but i didn't find a solution. I have download the font and installed it. Now its working only for my LibreOfficeWriter. I am following gem…
Yogesh
  • 37
  • 1
  • 11
0
votes
1 answer

Money-rails gem: How to use Money object in ActiveRecord query?

Before I installed the money-rails gem, I had this query in my controller: @forecasts.where('max >= ?', @budget).limit(1)[0] where :budget was an integer column in table forecasts. After installing money-rails I renamed that column to…
-1
votes
1 answer

Add a model that uses money-rails

I want to create a model named "Donations", which has an attribute named "amount" which will be utilizing money-rails gem. Please guide me how to initiate the process. Will it be generated similarly, just need to add "monetize" in that model? Would…
Fuaad
  • 197
  • 15
1 2 3 4 5
6