similar to: Getting number of days in a month

Displaying 20 results from an estimated 6000 matches similar to: "Getting number of days in a month"

2006 Feb 03
6
Saving a User Object while in the Address Controller
Hi, My saves are failing me and I can''t figure out why. I am trying to save an address id to a user object just after I create the address. This isn''t the exact code, but it shows what I am trying to do. class AddressesController < ApplicationController def create @address = Address.new(params[:address]) saved_address = @address.save @user =
2006 Feb 23
11
Need help for simple RoR code.
I try a ''hello world'' demo here,It only show a ''hello word'' on web page you can see all my codes and structure here http://www.smtservers.com/demo/ I want to access the ruby app like this http://www.smtservers.com/demo/say/hello but I get a 404 error. Please let me know what problem the code have I am new for RoR. I am not sure the site structure is ok or
2006 Feb 13
11
ROR code syntax highlighting on blog?
I am interested in putting the cool syntax highlighting for ROR code. What''s the best way to do that? Is it using textilize or another formatting language? Or do I need special stylesheets? Any assistance is appreciated. Thanks Frank --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. -------------- next part
2006 Feb 11
6
Rails Edge, has_many :through in searches
I have two tables, a Projects table and a Clients table. It''s basically a HABTM relationship, but I have additional project/ client-specific information in the join table. I''m trying to use the new has_many :through method to join these. It works fine when displaying records, but when I try to search, I''m having this problem: When I used a HABTM model to search
2006 Feb 03
2
Calling a javascript function after loading a partial with rjs
Hi, Is is possible to call a javascript function once a partial is loaded. Here''s what I am doing. I have a partial that gets updated via. an ajax call. When the partial is updated I want to call a javascript function ( enableTooltips ) which will then add tooltips to my links in the newly updated partial. Any help would be greatly appreciated. Thanks, Eric -- Eric Goodwin
2006 May 11
6
Dynamic data passing thru Rails to Flash
Hi, I am using Flash Dashboard and 3 sets of listbox. When i change my first list box say name i need to dynamically change the second list box and from the second list box when i choose an name i need to change the content according to this in the third list box. How can i pass this datas from database in rails. thanx g.balaji -- Posted via http://www.ruby-forum.com/.
2006 Jan 09
7
Large select list, speed issues
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> <font size="-1"><font face="Verdana">I have a piece of code in my page to generate
2006 Jan 27
5
Multiple Apps running under Lighttpd with scgi on a Windows Box ... possible?
I''ve run into a problem on one of my development machines. I''m trying to run multiple rails apps on one dev machine that runs Windows. Problem is that is seems that I can only run one scgi_service at a time, meaning that only one of my apps will function at a time. Anyone know how I can get around this, other than getting a *nix box (which I should have soon, hopefully) ?
2008 Apr 04
5
First call to worker method doesn''t work
I have a worker as follows: class SampleWorker < BackgrounDRb::MetaWorker set_worker_name :sample_worker def create(args = nil) # this method is called, when worker is loaded for the first time end def my_method # Deliver test e-mail message Notifications.deliver_message(1, "DM") end end I have a rails controller that calls the following code: worker =
2006 Feb 03
3
Breakpointer not working
When I try to run script/breakpointer, I get the following error: /usr/local/lib/ruby/1.8/drb/drb.rb:837:in `getaddrinfo'': getnameinfo: Non-recoverable failure in name resolution (SocketError) It''s Rails 1.0 on OSX 10.4.4. Any suggestions?
2006 Mar 30
5
Has_many :through problems -- please help
I''m having a lot of trouble with has_many, :through and could really use some assistance. I''ve got a User and Group class. Users can subscribe to groups, and groups should know who''s subscribed. I''ve got a join table (group_subscriptions) with group_id, user_id, and it''s own id element. Users has "has_many :groups, :through =>
2006 Mar 01
1
Net/Https & active_rbac & Debian Sarge
Hi, I''m attempting an install of active_rbac but am having some troubles. I''m running Debian 3.1 sarge and I am getting an error saying that I need to have net/https installed. I checked out my ruby lib and net/https.rb is nowhere to be found. I''m running the default ruby for Sarge which is 1.8.2. Was https.rb not included in this build? How can I get around this? I
2006 Feb 10
4
How to do a find with conditions that contain an OR
Hi, I''m trying to do a find with a condition that has an OR on the same column. Say I only want to use find() but not find_by_sql(). I reduced my problems into the following: values = [] ... # filling up values from params Order.find(:all, :conditions => ["(action = ? OR action = ?) AND price = ?", values] For example I
2005 Dec 30
3
Select SUM(?) Query
When using PHP, I was able to enter a query against my list of invoices such as : Select SUM(amount) from invoices where project="123" This would give me the total amount of all invoices for project 123. In rails, how would I do this? I tried using "find_by_sql," but couldn''t figure out how to extract the results out of this. Thanks!
2006 Jan 09
3
Custom flash[:notice]
For the most part, my flash[:notice] messages fall into one of two categories: either a message stating that something happened successfully (which is colored green), or messages showing errors (which I would like to be red). Is it possible to set some sort of flag on these messages to choose which color I want to show, or would I need to base it on CSS and set the class in the text, i.e.
2006 Mar 25
11
Firefox ''Rails Mailing List'' search engine plugin
Hi all, If you''re like me you probably spend a lot of time search the Rails mailing list. To make life a little bit easier I''ve created a nice little plugin for firefox ( A whopping 15 lines of markup ). The plugin uses nabble.com to search the mailing list. Anyways, I thought I''d share. If you want to install it the manual way, here''s the code. <search
2006 May 12
4
POST vs GET
I read in the Agile Rails book that I should avoid GETs for destructive actions. I notice that on 37signals'' Backpack web site, deleting an item in a list is accomplished with a simple click on a picture of a trash can. Is this a violation of the POST/GET rule noted above, or is there some way to make a clickable link send a POST? Ben
2006 Mar 30
4
ActionMailer e-mails getting tagged as junk in Outlook 2003
Whenever an email is sent via ActionMailer, and the recipient is using Outlook 2003 (with SP2 installed), the e-mail is getting put in the junk e-mail folder. Since Outlook doesn''t give a reason it was tagged as junk, it''s hard to determine what to change. I''ve compared the message headers of the "junk" mail and a valid email sent through Outlook, and the
2006 Jan 21
4
Single quotes in parameters
I have a "search" action for my "projects" controller, which defines a set of projects as follows @projects = Project.find(:all, :include => [:user,:clients], :conditions => "name like ''%" + params[:query] + "%''",:order => ''number'') This works fine, until I type an entry into my search box that has a single
2006 Feb 12
3
AJAX to a table row
Hello- I''d like to throw a little AJAX into a table to allow the user to edit a single row of data inline rather than moving to another page. The row (which has N columns) would be swapped out for a row which has a single column (colspan="N") and the form inputs would be in that row. My question is, is this legal HTML? I can''t find anything that says either way.