similar to: Decimal fields generated in Rails 2.3.5 act like strings, sort of

Displaying 20 results from an estimated 9000 matches similar to: "Decimal fields generated in Rails 2.3.5 act like strings, sort of"

2010 Apr 03
2
Specifying a decimal field precision/scale with scaffold requires 2 steps?
Hi, It appears to me that the command: ruby script/generate scaffold whatever money_field:decimal(10,2) will not generate a valid migration. Therefore it appears to me only two ways to achieve the desired result is: 1.1 Omit the the precision/scale on the scaffold command 1.2 Edit the migration file by following the "do |t| ... end" with the command: change_column :whatever
2010 Mar 12
7
"We're sorry, but something went wrong." from RoR app
Hi All, "We''re sorry, but something went wrong." is the message I got when I started up an RoR app in the environment: Rails 2.3.5 Ruby 1.8.6 WinXP-Pro/SP3 Firefox 3.6 MySQL 5.0.37-community-nt Mongrel The app under development was working fine until I (stupidly) thought I needed to upgrade MySQL to 5.1.44. I took the precaution of MySQL-dumping the development db before
2010 Mar 22
7
How to reference a select_tag within a form
Hi All, Inside my app\views\expenses\new.html.erb file, I had the code: <% form_for(@expense) do |f| %> [snip] <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <br /> <div id="vendor_droplist> <%= select_tag "test", options_for_select(@current_vendors.collect { |v| v.nickname }), {:multiple
2010 Jul 16
31
Added associations but don't see generated methods
Hi, I''ve got a Rails app working that includes two two classes, etc.: Expense & Vendor. I eventually learned that the mental concept I had of their relationship should be express in Rails as: class Expense < ActiveRecord::Base; belongs_to :vendor; end class Vendor < ActiveRecord::Base; has_many :expenses; end
2010 Jul 06
4
Simple routing problem
I''ve got the following in config\routes.rb: map.resources :users In app\views\shared\_menu.erb, I''ve got: Please sign in <%= link_to "here", :controller=>"user", :action=>"sign_in" -%> In app\controllers\users_controller.rb def sign_in end When I run the application, I crash with: Routing Error No route matches
2010 Apr 14
35
Conditionally adding a link to a form -- how?
I''ve got two entities created by scaffolding: Expense & Vendor In Expense#new there''s a form with a Vendors-drop-down and a NewVendor- button. The latter button brings up Vendor#new. The Create button in Vendor#new brings up Vendor#show with Edit & Back links. I want to append a third link conditionally to Vendor#show: if the Expense#new form led to the Vendor#show
2010 Mar 20
4
Displaying an image in a Rails form_for
Hi, I''ve got a public\images\DownArrow.jpg and app\views\expenses\new.html.erb that want to present this image in the following context: <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <%= f.image "DownArrow.jpg" %> <br> <%= select_tag "test", options_for_select(@current_vendors.collect {
2008 Nov 21
15
Switching the version of Rails that an app uses
Hi All, I’ve got a few versions or Rails installed and I''d like to run an App I’m developing with various versions of Rails. I heard of two ways to switch the version of Rails that an app uses: 1. Use GitHub as described by http://kylecordes.com/2008/04/30/git-windows-go/ . But that requires using Bash in a Command Window and more steps than I want to go through. 2. Alter
2008 Aug 22
2
How to find/open Spec::Expectations and Spec::Matchers
Hi, Then RSpec 1.4 recommends, in the webpage http://rspec.info/documentation/expectations.html, referencing the subject items. I''m running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] over WinXP-Pro/SP2. I believe I installed RSpec with a Ruby gem. At least, I think that''s confirmed because I have a lot of stuff in the directory K:\_Utilities
2006 Feb 23
3
Decimal comma instead of decimal point (i18n issue)
Hello, What is the easiest way which enables usage of decimal comma "," instead of decimal point (".") . I would like to force all RoR views to display float numbers with comma instead of decimal point and also to allow insertion of float numbers with comma in forms. Thanks in advance, Karel -- Posted via http://www.ruby-forum.com/.
2006 Apr 11
2
Schema.rb and MySQL decimal
Hi, I have a mysql schema with some decimal(20,20) fields. Now, I made a rake db_schema_dump for deployment of my applications on other machines. Rails created a schema.rb with the decimal fields as float. After a rake db_schema_import the fields are just float not decimal. How can I force rails to create decimal(20,20) columns instead of float? Thx. Marc -- Posted via
2006 May 04
3
Decimal
Can someone please tell me the best approach to adding support for editing MySQL decimal types in rails? I have a field in the DB that represents currency, and the view will not let save anything past the decimal place so, 10.99 becomes 10.00 automatically. Any help is appreciated. -- Posted via http://www.ruby-forum.com/.
2006 Jun 30
4
always show 2 decimal places
Hi, I have a float that often looks like somthing like 2003.2 in my controller (1 decimal place) Is there a way to always show it to 2 decimal places eg 2003.20 ? Thanks Scott -- Posted via http://www.ruby-forum.com/.
2012 Oct 26
2
Number of decimal places
When estimating values ??each determined similarly, and in which get to them by algebraic operations in some cases, are rounded with 0 decimal places and in other cases with 2 or 3 decimal places. What is happening? Thank you. -- View this message in context: http://r.789695.n4.nabble.com/Number-of-decimal-places-tp4647549.html Sent from the R help mailing list archive at Nabble.com.
2009 May 14
2
specify the number of decimal numbers
Hi, I was wondering how to specify the number of decimal numbers in my computation using R? I have too many decimal numbers for my result, when I convert them to string with as.character, the string will be too long. Thanks and regards! -- View this message in context: http://www.nabble.com/specify-the-number-of-decimal-numbers-tp23538852p23538852.html Sent from the R help mailing list archive at
2006 Feb 13
2
R-help, specifying the places to decimal
Hello - R-experts, Is there any way with which we can specify the number after decimal point to take. Like I have a situation where the values are comming 0.160325923 but I only want 4 place to decimal say 0.1603. Is there any way for that. I am no expert in R- and this may sound simple to many.sorry Thanks for any help. With Regards Subhabrata
2003 Mar 14
2
numbers and decimal points
I have a question for our European readers: how common is it to use commas as decimal points in spread-sheet and statistics applications? Is it an inconvenience to require that all data use a period as decimal point? (i.e., 3.14159 rather than 3,14159). We're trying to make our program as foolproof as possible, and would prefer not to give users a chance to have commas as both decimal
2011 Jan 14
2
read in data, maintain decimal places
Good day, All, Is there any way to maintain the number of decimal places in the type of situation below? I would like to maintain the number of decimal places in 0.667, despite the fact that its column-mates have a fourth decimal place. Thank you for your time. Jim dat.txt contents: MARKER ALLELES FREQ1 RSQR EFFECT2 STDERR CHISQ PVALUE rs6599753 C,T
2009 Mar 18
4
[LLVMdev] decimal to floating point conversion
Hi all: I need an instruction that can convert decimal values into floating point numbers. i.e. say I have a decimal number 1110794174 (== 42355FBE in hex ) and (== 45.3435 as a float) essentially the mantissa and exponent representation needs to be used. Is there any way of doing this in llvm? Thanks and Regards -- -- Aparna Kotha Graduate Student Electrical and Computer Engineering
2008 Jul 16
1
date to decimal date conversion
Hello R Users, I want to convert date (yr, mo, day, hr, min, sec) to decimal date, for example: Date (in six columns): yr mo dy hr min sec 1993 02 13 05 52 00 Converted to Decimal date : 1993.3542 How to write a small code in R so I can convert six column date to decimal date Many thanks, Yogesh -- Yogesh K. Tiwari (Dr.rer.nat), Scientist, Indian Institute