similar to: newbie :: Convert integer to string in Ruby

Displaying 20 results from an estimated 10000 matches similar to: "newbie :: Convert integer to string in Ruby"

2007 Apr 10
7
Newbie :: Help !!! (database record compare)
Hi all, I''ve a two simple table, resource ======= resource.id resource.name resource.contact and project ====== project.id project.name project.resource_id (id from resource table) I want to display list of project that only belong to particular resource. my proj.rhtml is like ===================== . .. ... <h1>Projects</h1> <table border="1">
2006 Mar 13
7
Wilcard search
Hello, I''m writing a search function for my application, but I am unsure on how to search for all results that contain my search string; here''s what I''ve got: def search @products = Product.find(:all, :conditions => "date_available < now()", :conditions => [ "title ilike ?",
2006 Mar 19
2
Functional Testing
Hey all, I have a many-to-many relationship (Questions has_and_belongs_to_many Answers), and when I destroy the Question (the one) I also destroy all the Answers (the many). Since the following doesn''t seem to work for has_and_belongs_to_many: class Question < AR::Base... has_and_belongs_to_many :answers, :dependent => :destroy end I have this embedded in a transaction block
2006 Jul 25
12
DRYing - similar named fields, etc.
I''m sorry - just couldn''t come up with a subject that describes the problem :( Anyway, this is my problem. I have a long list of fields that need to be displayed when a ''show'' is requested on the controller. I''m now doing the list.rhtml and looking for a DRY way to do the following. For each data item, I have 2 fields - one is the item name, the
2006 Mar 09
4
sort-weirdness - active record issue?
I''m selecting data into a controller and sorting it. The code (in the controller) looks like this: def index @assignments = [] tasks = Task.find(:all, :conditions => ["person_id = ? and actual_end_date is null", session[:user].id.to_s ]) issues = Issue.find(:all, :conditions => ["person_id = ? and status <>
2006 Feb 07
3
Newbie help ..
Hi .. I am new to Rails and it is not clear to me why I am getting the following error. Any help appreciated. -m. $cat app/views/admin/new.rhtml <% @page_title = "New member..." -%> <%= start_form_tag( :action => ''create'' ) %> <table> <tr> <td> First Name: </td> <td> <%= text_field(
2006 Sep 11
2
Compilation Errors
Hey there, I just updated to ferret 10.0.4, and acts_as_ferret 0.3, and now when I try to run my app with mongrel on Windows, I get very strange compile errors: ompile error C:/rails/app/script/../config/../app/views/login/index.rhtml:8: Invalid char `\002'' in expression C:/rails/app/script/../config/../app/views/login/index.rhtml:9: syntax error _erbout.concat "
2006 Aug 13
4
Javascript compression / How to hook in to rails development
Hi there, I thought it''s rather neat to use the javascript compression from http://dojotoolkit.org/docs/compressor_system.html This removes javascript comments and renames variables and seems pretty reliable and effective. For example, I keep the original htmlarea.js file from http://xinha.gogo.co.nz/ in a file htmlarea.js.txt and it compresses from 200K to 100K. With gzip it
2006 Jan 26
42
ruby script/generate scaffold Product Admin hangs
Hi I am running Mac OX tiger with the installed ruby 1.8.2, and mysql5 (I checked that it was running in preference). I tried to run the various fixes recommended in agileweb. I am stuck on page 57, script/generate scaffold... > Could you paste in your database.yml file, from the > "config" folder inside your Rails app? If you have any > passwords entered there, you should
2006 Mar 01
15
Is there a perl equivalent of .= in ruby/rails??
I want to make a for loop that concats strings onto a variable: html .= var1 + "this is a test" + whatever What is the syntax that does this in ruby/rails? Also, is there a ''print'' method in ruby? Because when I try to use render_text it will only let me use this once. -- Posted via http://www.ruby-forum.com/.
2009 Feb 16
2
working with Blocks
hey I am able to do: block_func(x, y) do .... end But if I try to do this: form.block_func(x, y) do .... end I get an error like this: syntax error, unexpected '')'' @output_buffer.concat " "; @output_buffer.concat (( form.block_func(x, y) do ).to_s); @output_buffer.concat "\n" Any ideas? thanks
2006 Jan 19
9
start_form_tag not taking url_for options
I''ve got a form that should post to user/login. The code to start the tag is: <%= start_form_tag { :controller => "user", :action => "login" } %> That gives me this exception: compile error script/../config/../app/views/user/login.rhtml:1: parse error, unexpected tASSOC, expecting ''}'' _erbout = ''''; _erbout.concat((
2006 Jan 10
7
All My Rails Apps Died Over the Holidays
I have several Rails (version 1.0) apps I''m working on on a Win XP box using Webrick that were working fine before I left for the holidays. I came back, started up and they all get the same syntax and compile errors: compile error ./script/../config/../app/views/time/list.rhtml:4: Invalid char `\212'' in expression repeated over and over. Refreshing the page gives thes same
2006 Jun 09
2
edit- view duality
Skipped content of type multipart/alternative-------------- next part -------------- *********************************************************************** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. Bear Stearns does not provide tax,
2006 Apr 07
13
Pop up menus - any ideas?
I''ve got a menu in which I have all of my categories as links. Each category also has subcategories. I want to set it up so when you mouse over the category the subcategories will pop up (to the right of the main list, but that''s just CSS). This is what I have so far: <% for category in @categories %> <a href="#"
2007 Feb 12
1
Invalid char problem
Has the problem with corrupted .rhtmls (invalid characters) been solved so far? I would like to use ferret and acts_as_ferret on Windows XP. I have installed 0.10.9 (mswin32) which still seems to have the problem. I am receiving error messages like: compile error C:/INSTAN~1.4P1/INSTAN~1/rails_apps/travelogue/config/../app/views/article_editor/_header_read.rhtml:2: parse error, unexpected
2010 Feb 19
8
Weird gsub behaviour
ruby 1.8.6 (2007-09-24 patchlevel 111) str = ''\&123'' puts "abc".gsub("b", str) puts "abc".gsub("b", "#{str}") puts "abc".gsub("b", str.to_s) puts "abc".gsub("b", ''\&123'') puts "abc".gsub("b", "\&123") >ruby test.rb ab123c
2007 Apr 05
4
newbie :: Create document from database
Hi all, I am newbie to ruby. I am creating web based data management tool using ruby on rails. I''ve done with interface and data management. Now I want to create a document from database. I want my database values should reflect in standard doc format, like a template. How can I do it in ruby. I am using MySQL-front as back-end. Please help me out. Thanks, -aveo -- Posted via
2006 May 08
7
How to get difference between two dates in days???
Hi, I want to calculate difference between Current date & previous date (stored in database). The difference should be in days. Hhow to do that?? PLs tell me. Thanx in advance. Prash -- Posted via http://www.ruby-forum.com/.
2015 Jul 16
2
[LLVMdev] Adding integer field to all C++ classes in LLVM
Hi, I want to add an integer field to all C++ classes in LLVM. Where do I look at in the LLVM source to make the necessary changes? As of now, what I understand is that I need to make changes in Type.cpp (llvm/lib/IR/Type.cpp) where I insert an integer field in the ArrayRef passed to StructType::setBody? Thanks! -Mohit. -------------- next part -------------- An HTML attachment was scrubbed...