similar to: Class definition OK?

Displaying 20 results from an estimated 4000 matches similar to: "Class definition OK?"

2006 Jun 01
4
How do I get today''s date?
I know this is a simple question, but i just want to put the current day, month, date and year on my website. I still can''t figure out how to read the Rails API. Can anybody help me out? TIA -- Posted via http://www.ruby-forum.com/.
2006 May 12
8
switching from development to production?
I think I''m missing a step here, but they don''t seem to cover this in the AWDWR book... does anybody know the various steps required to switch from development to production mode in Rails? I''ve scoured the application and changed everything that stands out, but the damn thing is still running off the development database and won''t connect to the production
2006 Apr 06
2
making an integer from a float
Does anybody know how to turn a floating-point number (i.e. 60.345) into an integer by cutting off or rounding the decimal portion? Either method, or both, would be quite welcome. Thanks! This forum rocks! -- Posted via http://www.ruby-forum.com/.
2006 Jul 05
3
splitting a story with double-spaced para''s
Quick question - if i want to separate a long string of text, separated by single carriage returns, into an array of paragraphs, I can use the following code: paragraphs = article.content.split("\n") The "\n" means a carriage return, as far as I can tell. If I wanted to take text, that had been written using the more common double carriage returns, into an array of
2006 Apr 03
15
How should I pick a random entry from the database?
Hi guys. Total newbie here. I''ve been doing web stuff since 1996 but only began the foray into scripting last year. I haven''t got my skull completely 360 degrees around OOP yet. It''s just me here (in Japan) and there are no Ruby groups in my area (never mind any in English). I''ve got a database table - real simple: question, answer, and id fields - and I
2006 Mar 30
7
text_area
How to make that the typed code on ruby in text_area it was carried out in @params ["name"]?? -- Posted via http://www.ruby-forum.com/.
2006 Jun 06
8
How do I wrap a <%= link to %> around an image?
I''ve got a bunch of dynamically generated link paths that I want to use to link some dynamically-generated image paths. Specifically, I want to link thumbnails in a gallery to the larger images. But I''m stymied by Rails'' syntax. I can''t figure out how to do this. I tried this: <%= link_to(image_tag("../../images/photos/photo.photogroup/TN_
2006 May 17
5
Today is "Rails Hates Me Day"
Has anybody had Rails just refuse to cooperate with anything? I had an application working great in development mode, then switched it over to production, tried to host it, but couldn''t. Some error that I can''t figure out. So I decided to create a simpler application, host THAT in little baby steps until something went wrong so I could tell maybe where I was losing it.
2006 Jul 05
2
splitting a paragraph into words and spaces
I''m using this: <% words = article.content.split(/ /) %> <%= words[0..20] %> to (ostensibly) split a paragraph into component words, with spaces in between, then print to html only the first 20 items, words and spaces. I got this (split(/ /)) from the online pickaxe book at http://rubycentral.com/book/ref_c_string.html#String.split . The problem is, the resulting array
2006 Jun 08
1
built-in dropdown jumps?
Hey everybody! I was just wondering if Rails'' javascript library includes something as simple as making a dropdown that jumps to the link when selected without needing a "submit" button. I see a bunch of AJAX effects and draggable-element stuff, but all i need is a simple dropdown... should I code it myself? -- Posted via http://www.ruby-forum.com/.
2006 Apr 07
22
Find WHERE in Rails
I''d like to find all records that have a certain integer as their "level" field in the database. I know how to find all the records: allquestions = Question.find(:all) ...and I know how to find the one record that has a certain id: allquestions = Question.find(params[:id]) ...but how do you find all the records that share a certain value in one of their fields? I tried
2008 Jan 26
0
JRuby version of win32-api - initial try
Hi all, I''ve got a preliminary JRuby version of win32-api checked into CVS at the moment under win32-api/lib/win32/api.rb. I''ve also pasted it below. It doesn''t quite work right in that I can''t get it to modify the arguments in place in the API#call method. Take a look at the sample code at the very bottom to see what I mean. I haven''t even tried
2006 Nov 04
2
Possible to use attr_reader/writer in model?
I have some properties that I want setable externally, but readable only internally. I''ve played around with attr_writer (and attr_reader separately) but can''t figure out how to get either to work. I can do what I want using attr_accessor, or just straight out defining the prop setter method. Anybody know how to use attr_writer or attr_reader with a model? You da man, Joe
2007 Jan 25
4
How to change the menu depending on the controller/method?
Hello, I''m still dtarting with ruby on rails. And I''m trying to have a menu depending on the current controller/method. Here is what I was thinking of (please tell me if there''s a better way to do it): I have a database with menu_groups (corresponding to controllers) and menu_elements(corresponding to methods). Each menu_element belongs to one menu_group. I created a
2006 Apr 12
1
Dynamically updating list
hi every body. i am try to do example of agil books.dynamically updating list of chapter 18. 1)this is my code for controller---- class ListnoajaxController < ApplicationController def index @items = Item.find_recent end def add_item item = Item.new(params[:item_body]) render(:partial => "item", :object => item) end def item end end 2)the code for item class in app/model class
2006 Jul 24
1
Newbie error: undefined local variable or method
When I add an item to the shopping cart, I get an error: undefined local variable or method `cart_item'' for #<#<Class:0x3715a78>:0x3715a48> Session info says the cart being updated properly. I''m just not able to output two variables: <%= cart_item.quantity %> &times; <%= h(cart_item.title) %> I did some research, and I can grasp that local
2008 Feb 16
2
nil error?
Hi everyone, I''m sure I''m doing something stupid with this, so if somebody could talk some sense into me that would be great :) I''m trying to just increment a variable and I think I''m missing some basic concept (this is RoR 2.0.2 btw) So have a "players" table with several variables, including one called "odds". I''m using the
2008 Jun 04
2
Win32-ole start
Hi all, Since I didn''t get any takers on the win32-ole rewrite I thought I''d take a stab at starting it. Here''s what I''ve got so far (along with some extra constants in Windows::COM only in CVS), but the call to CoCreateInstance() isn''t working. I''m not sure if I''m dealing with the IDispatch interface properly: # win32/ole.rb require
2016 Apr 23
0
RFC: [Patch] libpuload: use previous TFTP OK status definition
libupload: Use previous TFTP OK status definition FTBFS: com32/hdt/hdt-dump.c:227:39: error: ?TFTP_OK? undeclared (first use in this function) Signed-off-by: Gene Cumm <gene.cumm at gmail.com> Should we trim "ERR_" off the definition or change all of the places this macro is used? Trimming means we have two possible spots with incongruent definitions (bit order difference).
2006 Jul 18
0
Two backgroundrb questions
On Jul 18, 2006, at 6:24 AM, Matt Mower wrote: > Hi Ezra, > > I''m converting some code I have which basically ran Enumerable#map > asynchronously using a thread-per-value to use backgroundrb > (recommended by zedas). That code works but I have a scaling problem > and needed to introduce throttling. > > However now that I''ve looked at it I don''t