Displaying 20 results from an estimated 7000 matches similar to: "reusing previous code"
2006 May 24
2
Gallery2 integration
Is anybody working already in a gallery2/rails integration?
I need to use it as part of my project, so, before start from scratch
with it I''d like to know if already is something out there.
Thanks.
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 Mar 12
1
Problem with --partial and rsync algorithm
Hi,
I'm running the following command for a remote host backup:
/usr/local/bin/rsync -a --delete --delete-excluded -v --timeout=120 -z
--no-whole-file -partial --partial-dir .rsync-partial --exclude=/sys/*
--exclude=/tmp/* --exclude=/stuff/distfiles/* --exclude=/stuff/sistema/*
--exclude=/stuff2/ftp/* --exclude=/stuff2/backup/* --exclude=/home/ftp/*
--exclude=/home/gentoo/* --exclude=/mnt/*
2006 Jul 18
7
Observer not working
Help please.
I''m trying to observe a User class, but I can''t get this to work, the
after_create method never gets called... (the breakpoint never gets
called)
app/models/user_observer.rb:
class UserObserver < ActiveRecord::Observer
def after_create(user)
breakpoint
setting =
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 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 Jun 23
5
create session only for logged-in
i was wondering how a blog db has grown by about 15 mb in a week or two. it turns out its the sessions table..
so ive tried this:
class ApplicationController..
session :off
end
class AccountController
session :only, :login
end
and now, its impossible to login, and nothing ever appears in the session table. is this the right approach? i dont want to weed out the sessions with cron, i just
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 Jan 04
3
date conversion
I have the date saved in a database in the following format
''20060102170020''. How do I go about converting the date in the format of
January, 01, 1901? I searched all over and found something similiar
using ''to_formatted_s''. However I only found support for converting
month to a three letter format (e.g. ''Jan''). Is there an eaiser way?
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