search for: to_is

Displaying 20 results from an estimated 407 matches for "to_is".

Did you mean: to_i
2008 Jan 11
3
Date range queries return zero results
Hello, I am having trouble getting data ranges to work correctly. I am using the following command to load the db: index << {:title => row[7].to_i, :date => Date.strptime(row[3], ''%Y-%m-%d''), :page_id => row[5].to_i, :page => row[6].to_i, :content_type => row[1].to_i,
2006 Mar 31
10
ruby help / if (cond or cond)
Why this code doesn''t work as expected? It raises exceptions everytime. Tried with || operator, too. validates_each :x, :y do |record, attr| record.errors.add (attr, ''between 1 and 100'') if (attr.to_i>100 or attr.to_i<0) end -- They say money can''t buy happiness? Look at the smile on my face... ear to ear, baby!
2009 Jun 18
3
Date.new.to_time.to_i
What''s going on here!? >> Date.new.to_time.to_i NoMethodError: undefined method `to_i'' for Mon, 01 Jan -4712 00:00:00 -0800:DateTime from (irb):25 >> Date.today.to_time.to_i => 1245308400 >> RUBY_VERSION => "1.8.7" >> Rails.version => "2.1.1" (I''m not sure if this is a rails thing, or just a ruby thing) --
2007 Oct 18
12
first cut at blockless given/when/then
Hi all, I committed a first cut at blockless Givens/Whens/Thens to RSpec''s trunk: cd /path/to/rspec/project svn up cd rspec bin/spec examples/story/calculator.rb Take a look at examples/story/calculator.rb to see what''s going on. Needs docs!!!! Thoughts welcome. I''ve also got a cut at the plain text parser checked in, but it''s not hooked up to anything
2008 Dec 13
2
Need Help in converting php encryption decryption code to ruby on rails
Hi guys i found this encryption decryption in php and try to convert it in rails but i am unable to successfully convert it. So plz help me. I you write the whole conversion code then it will be great. PHP code is like this ================ # #/********************************************** #** #** MD5 block cypher #** #** Author..: leapinglangoor [
2006 Jun 13
17
reconstituting a date
In my view code, I have <%= datetime_select "in_out", "time_in" %> which returns in params :in_out: !map:HashWithIndifferentAccess time_in(1i): "2006" time_in(2i): "6" time_in(3i): "12" time_in(4i): "20" time_in(5i): "24" and I want to save that datetime to a column in the db... if
2006 Oct 17
0
[680] trunk/wxruby2/samples/printing/printing.rb: Cleaned up to use the Ruby naming convention, added #! line, now uses Wx default ID''s in standard menu items.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding:
2006 Mar 22
2
What is wrong in this method??????
Hi, This is my definition of method "add_to_cart" ======================= def add_to_cart count=params[:product][:count] while count.to_i>=0.to_i if params[:product][''dem_quantity''+count.to_s]=="" else @product = Product.find(params[:product][''product_id''+count.to_s]) print @product.name
2010 Mar 31
6
any body can help me ?? why is this happen??
Hii All I use ruby 1.8.7 I run irb and type: a = (0.29 * 100).to_i the result is 28 why?????? could u explain to me.. Please???? THank you -- Senior Rails Developer Anton Effendi - Wu You Duan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2009 Nov 19
12
Templates and loops..
How come this doesnt work? I write this in a normal ruby script it works just fine. <% for cpu in (0..processorcount) %> I want to loop through the number of processor so a specific action can be taken to generate content for a file. I get an error on the master of: bad value for range at /etc/puppet" -Chris -- You received this message because you are subscribed to the Google
2008 May 25
2
storing data from a txt file in ruby?
Hello Im trying to write a a ruby program that takes a list of books title ,author so on and i can read in the file with no problem but im trying to store the list into either a array or hash so i ca say run different methods view, delete ect.. anyhelp would be great this is what i have so far IO.foreach("book_list.txt") do |line| catalog=line.chomp.split(",")
2010 Aug 03
10
Returning last value
Hi. I have the following controller of the update action: [code] def update @projeto = Projeto.find(params[:id]) if (@projeto.update_attributes(params[:projeto])) ## Mesmo raciocĂ­nio utilizado no create. @permissaoA = Permissao.find(:first, :conditions => ["usuario_id = ?", @projeto.responsavel.to_i]) @permissaoAvancado1 = Permissao.find(:first, :conditions
2006 Jun 28
4
argument out of range...
Hi... I''ve a problem with this : [code] def fir_tahiti @notams=Array.new Notam.find_all_notams().each do |notam| @notams.push(notam) if (to_secs(notam.debut)<Time.now.to_i and to_secs(notam.fin)>Time.now.to_i) end end def to_secs(str = nil) Time.gm(2000+str[0..1].to_i, str[2..3].to_i, str[4..5].to_i, str[6..7].to_i, str[8..9].to_i).to_i if str end [/code] It tells
2009 May 28
1
[PATCH server] Change default flexchart view and increase vertical dimension of flexchart area.
--- src/app/views/graph/history_graphs.rhtml | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/views/graph/history_graphs.rhtml b/src/app/views/graph/history_graphs.rhtml index 9488367..7a7e1e1 100644 --- a/src/app/views/graph/history_graphs.rhtml +++ b/src/app/views/graph/history_graphs.rhtml @@ -7,10 +7,10 @@ $('#flex_history_chart').flash( {
2006 Jul 02
5
Question about setting field values for a belongs_to model
I have two tables, applicants, and skills where each applicant "has_many" skills, and each skill "belongs_to" an applicant. When I have a reference to an applicant and a (skill) id for one of their skills, I thought to update their skills by using @applicant.skills.find(id_of_skill).description = ''new description'' # even adding
2006 Nov 04
0
weird problem with content type
Hey all, My site is working ok except for a page that displays as text instead of html. I tried to use this: puts "Content-Type: text/html" then it display the page as html normally but I still get that ugly part on top of my page: Content-Type: text/html Set-Cookie: _session_id=6356b18a24d56a0da01bfab791fa911d; path=/ Status: 200 OK Cache-Control: no-cache here is the url:
2006 May 23
2
Ordinalizing a date
I''m trying to use the ordinalize() method to ordinalize a day. Here''s how far I''ve gotten: @reportday = Time.now.at_beginning_of_week.strftime("%d").to_i @ordinalized_reportday = "#{@reportday}".ordinalize I was thinking it wasn''t working because the date is being returned as a string, however I added the .to_i and still it returns an
2006 Mar 17
1
How to update values in database in this form?
Hi, This is my rHtml page & Corresponding actions & model pages:- ===listform.rHtml================= <h1>Products List</h1> <%= start_form_tag(:action => "add_to_cart")%> <table> <tr> <% i=0 %> <th> Product No. </th> <th> Unit Price </th> <th> Available Qty. </th> <th> Demand Qty. </th>
2005 Sep 23
6
problem with acts_as_tree
Hi, I''m using the latest gem version of rails under MacOS Tiger. I was trying to use acts_as_tree as described in the rails book. So I have something like: class Category < ActiveRecord::Base acts_as_tree :order => "title" end create table categories ( id int not null auto_increment, title
2006 May 11
9
Undoing a SHA1
Hello for my password recovery system I want to recover the users password and send it to them. In the DB its saved via SHA1 (login generator) -- Posted via http://www.ruby-forum.com/.