Displaying 20 results from an estimated 1100 matches similar to: "date conversion"
2006 Aug 14
5
Tutorial for Queries
Hi!  I''m looking for a good tutorial that explains the main points of 
performing queries with Rails.  I do have AWDWR and have read the 
section on ''find'' but I''m looking for something that goes into more 
detail on how to perform queries across tables.
Abstracted from my current application, this is an example:
* person has_many sites
* site has_one room
*
2006 Jul 29
3
Engines question
I would like to get at all models in a rails application to be able to
add a field to every one of them as part of a migration. Something
like the following:
Appmodels.each { |x| add_column x.table_name.to_s, :foo, :text }
I understand I can get the table name using
ActiveRecord::Base#table_name, but how do I get all the models into an
array that I can use in the above manner?
-- 
Cheers,
Hasan
2006 Jan 18
2
Migration?
I just installed ruby, lighttpd, and mysql from darwinports on me  
laptop in lieu of the Apple version of ruby. Now when I fire up my  
rails application, it''s not running lighttpd anymore -- it''s running  
webrick. It also exits immediately. MySQL is running, the database  
and tables are restored from the backup. What step am I missing?  
Thanks for the help!
Cheers,
Hasan
2006 Aug 13
3
escape block using red cloth
Hi all,
Is it possible to configure red cloth to escape a block such as:
------------------------------------------------------------------
Hello, _this_ works *beautifull*
[code lang="ruby"]
def foo
   bar
end
[/code]
------------------------------------------------------------------
The text in the [code] block should not be parsed by Red Cloth''s to_html
method.
I cannot
2006 Jan 02
5
How to use MySQL sum() to get total of column?
Easy one: Let''s say I have a table called ''employees'' with a column 
called salaries, how can I add Employee.salaries_total to the model? 
Thanks!
-- 
Posted via http://www.ruby-forum.com/.
2006 Feb 01
2
Uninitialized constant ApplicationController?
Hello list,
I''m trying to start my Rails server after doing a long complex switch
from Postgres to MySQL, and I''m getting the following error:
=> Booting WEBrick...
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in
`const_missing'': uninitialized constant ApplicationController
(NameError)
        from
2005 Dec 14
3
Geocode for Ruby
Hey,
 Does anybody know of a good Geocode library for Ruby, similar to Perl''s
Geocode::Postal, that i could use in my rail app? I need to do some "within
5 miles" calculations of zipcodes and i dont have a nice ruby (or gem)
utility to do it.
any help would be appreciated.
thanks
adam
_______________________________________________
Rails mailing list
2006 Aug 05
4
file_column just will not work...
Hello,
I have been trying for some time to get a file to upload using the 
file_column plugin.
My code is here: http://pastie.caboo.se/7304
But my code is not the issue. I cannot even pass the unit test that 
come with the file_column plugin.
If I run ruby file_column_test.rb i get:
1) Error:
test_store_dir_callback(FileColumnTest):
TypeError: can''t convert Fixnum into String
   
2006 Aug 04
3
forms and relationships
i''m still pretty new to rails, and while i''ve been able to hack my way 
into having it do what i want so far, i''m not happy with the way my code 
looks. on top of that, i''m sure that what i''m doing prlly isn''t the most 
efficient either.
one of my biggest problems is probably to do with using relationships 
and forms together. i''ve
2006 Jan 10
1
Ferret -- Search Partial?
I''d like to implement the search capabilities of Ferret and am  
looking for sample code to see how it''s done. I''m thinking my  
controller creates the index when "Search" is clicked and a partial  
is rendered. What is this partial supposed to look like? Is it built  
in to rails/Ferret? Thanks for the help!
Cheers,
Hasan Diwan <hasan.diwan@gmail.com>
2006 Feb 21
6
Select articles from group with id ''1'' and id ''2''
I have to tables: "articles" and "groups". Between I have
article_groups as a jointable. Now I want to select every article who
is a member of group with id ''1'' and id ''2''. Whats best way to get
that?
Extract from schemas:
CREATE TABLE articles (
id int auto_increment,
ingress text NOT NULL,
story_text longtext,
constraint fk_items_users
2006 Aug 18
3
Mysql::Error: Can''t create UNIX socket (24)
Any idea what this means? I have done many google searches and got 
nothing?
Any help is greatly appreciated.
-- 
Posted via http://www.ruby-forum.com/.
2006 Feb 08
2
What page is an item on?
Using the paginator helper, is there a way to determine what page an  
item in the collection is on?
Thanks in advance for your help!
2006 Aug 09
3
rel=nofollow or akismet
Hi guys,
My site ( http://shunya.in ) recently started receiving some spam and I had 
ignored the issue till it became a problem, and I guess it is becoming a 
problem now.
I looked around on suggested ways to address the problem and found two 
systems - CAPTCH and Akismet. I consider both of them in this email along 
with the reasons why I am debating using neither of them. Then I ask for your 
2006 Aug 04
8
I need an idea !
Hello here, I need to find an idea to solve a problem
I manage Events which are of kind :arrival or :departure
At first the two kind of events was unrelated but my client want to see 
the :departure belonging to the :arrival and vice versa.
I''m searching for a solution to implement this ''link''. I''ve thought 
about an integer column containing an uniq id for
2006 Apr 13
7
Complex SQL in paginate command?
Hi all,
Is there a way to create pagination with a complex SQL, more complex 
than the :conditions option will support?
I have two databases, houses and images.  Houses has_many images, and 
each Image belongs_to house.
I''m creating a search engine for the house records and I''d like to be 
able to filter out all the houses without any associated images.
So far I''m
2006 Aug 02
7
ActiveRecord does not close database connections?
I have an application that creates quite a few threads. I keep getting 
the "mysql too many connections" error.
ActiveRecord does not close the connection once a thread had died out.
To make things worse mysql has a wait_timeout variable that would 
basically kill off these connections for me, but there is a bug and I 
can not change the value of it. I have tried at least 10 different
2012 Jan 27
2
PosixCT subsecond accuracy
A sample of the data I have is:
> head(sensor)
      logged_on    accx   accy   accz compassx  compassy compassz
gyrox      gyroy      gyroz
1 1326561428000 -0.4602 0.8346 0.0936 0.145508 -0.350586 0.259766
59.617390  28.521740  59.617390
2 1326561428050 -0.4212 1.0452 0.1326 0.219727 -0.321289 0.241211
88.695656  27.478260  88.695656
3 1326561428100 -0.2496 1.3416 0.2886 0.214844 -0.326172
2006 Jul 29
3
Lighttpd Configuration Independent of Hostname or IP
Hopefully someone can help with a bit of lighttpd configuration for  
my production rails app in Mac OS X.
I have an application which will be accessed by many different  
domains and IP addresses.  Examples:
   http://crm.local/
   http://localhost/
   http://192.168.0.49/
   http://65.256.120.90/  (fake, but you get the idea, an external  
Internet facing IP address)
   http://crm.mydomain.net/
2011 Nov 29
2
Weird Excel Time Format
I have a 10-column XLS file, with 2 date fields. As far as I can tell,
they were configured identically in Excel 2010. One of these fields
resembles "39406.577662037", whilst in Excel, it is shown as
"2007-11-20 13:42:20". Applying as.Date() with the default format
doesn't do it. Any ideas as to what format this is? Many thanks! -- H
-- 
Sent from my mobile device
Envoyait