Displaying 20 results from an estimated 20000 matches similar to: "Ruby Classes"
2006 Mar 15
4
RJS template eating encoding
I was previously doing an update via .rhtml templates creating an AJAX
:evaluate_remote_response. I use UTF-8 in my pages, and my app
requires that I be able to, say, put Japanese characters in.
The problem is that when I switched this over to an RJS template it
started eating the encoding. I now get garbage characters where before
I got the correct ones.
The code for the RHTML:
<%=
2006 Mar 16
1
sql functions in cru ( not d )
Hi,
I''m looking at ways to encrypt email addresses rather than storing
them directly in the database.
There are several ways that it could be done. I could make an
Encrypter class and use before_update, etc. Or I could set up an
updatable VIEW in mySql. (I guess triggers might be another
possibility.)
However, what I would really LIKE to do is use the handy AES_ENCRYPT
and
2006 Jul 22
2
redirect_to error
Hi,
I have a redirect_to statement in a method that I would like to have
at the end of the method to take you to a ''Success'' page if
everything works.
When I hit the redirect_to statement, ( redirect_to :action =>
''show_success'' )
I get this in the browser:
Application error
Rails application failed to start properly"
The development.log
2005 Nov 11
0
cache_page throwing "undefined method merge" error
rails (0.14.2), OSX, webrick (right now - lighttpd in production)
I''m trying to cache pages with different file extensions and am having
a heck of a time.
This controller does nothing but display @cache.data (which can be XML or HTML)
Here''s the controller:
class DisplayController < ApplicationController
caches_page :xml, :html
session :off
def xml
@cache =
2006 Jun 28
2
perform_deliveries = false
Hi,
Can someone explain the proper use of the use of perform_deliveries
in the environment.rb file??
ActionMailer::Base.perform_deliveries = false
I just moved a new controller to the production version of an app,
but wanted to be sure everything was properly configured before
sending out a big mailing, so I set perform_deliveries = false,
believing that would prevent mail from being
2006 Jul 17
3
Extending Ruby classes in Rails
Hi.
I''ve placed the following in lib/mods.rb:
class String
def String.foo
"bar"
end
def bar
"baz"
end
end
But it does not get picked up:
white:~/svn/tagticks morten$ script/console
Loading development environment.
>> String.foo
NoMethodError: undefined method `foo'' for String:Class
from (irb):1
>>
2012 Jul 05
1
Ruby DSL parameterized classes and defaults
I''ve been reading the Docs on this, and its not very clear.
I want to have a parameterized class that takes arrays and objects as
parameters.
I''m using puppet 2.6.16.
I define a hostclass like this:
hostclass :test, :arguments => { :param1 => "blah" } do
end
I call from Puppet DSL:
class {"test":
}
I get this as an error:
err: Could not
2008 Aug 18
1
Converting monthly data to quarterly data
Dear R users,
I have a dataframe where column is has countries, column 2 is dates
(monthly) for each countrly, the next 10 columns are my factors where I have
measurements for each country and for each date. I have attached a sample
of the data in csv format with the data for 3 countries.
I would like to convert my monthly data into quarterly data, finding the
mean over 3 month periods for
2008 Aug 19
0
Converting monthly data to quarterly dataMonday, August 18, 2008 11:38 AM
Dear Gavin,
This is really great, thank you! I created some long loops to get rid of
extra months at the beginning and the end of my data but your code is great
for putting it then together quarterly.
thanks again,
Denise
On Mon, 2008-08-18 at 14:31 +0100, Denise Xifara wrote:
> Thank you very much Stephen, but how will aggregate deal with months that
> fall outside annual quarters? eg,
2006 Mar 28
3
compiling php with fcgi on tiger
I can''t figure out how to compile php with fcg enabled.
I found a website which gives an example of how to write options in
configure
http://scoops.totallyrule.com/articles/2006/02/01/mysql5-ab-package-and-php5
So I wrote
./configure --prefix=/usr/local --program-suffix=5 --enable-fastcgi
--enable-discard-path --enable-force-cgi-redirect
--with-mysqli=/usr/local/mysql/bin/mysql_config
2011 Oct 20
2
Expire plugin not executing for sieve plugin?
Running dovecot 1.2.12 on ubuntu 10.10. Here is the problem: I have
mysql backend for expire. I am using the dovecot-postfix package which
creates /etc/dovecot/conf.d/01-mail-stack-delivery.conf which looks like
this:
# Some general options
protocols = imap imaps managesieve
disable_plaintext_auth = no
ssl = yes
ssl_cert_file = /etc/ssl/certs/ssl-mail.pem
ssl_key_file =
2014 May 29
0
How to make the tests pass in an elegant way? Ruby on Rails
I am writing a rails app with my colleague who wrote a lot of the tests.
He had to take a leave of absence due to a death in his family, and I am
needing helps with changing the model so that the tests will pass in our
spec file.
Here is the model:
class Worker < ActiveRecord::Base
attr_accessible :first_name, :last_name
has_many :writings
end
Here is the spec:
2007 Feb 08
1
undefined method `find' for Status:Class
Hi,
I have attempted to install radiant on my server using mongrel. I have
it working fine using lighttpd on my development box, but as soon as i
attempt to run it using mongrel I get the following error:
NoMethodError (undefined method `find'' for Status:Class):
/app/models/page.rb:49:in `status''
/app/models/page.rb:57:in `published?''
2006 Sep 01
4
evaluating classes within component
I''d like to create a component that takes different actions based on the
classes associated with the node using the component. Is this possible?
Here''s what I''m thinking.
node www01 {
include webserver
website { "site1.com":
aliases => ["www.site1.com", "test.site1.com"],
username => www0001
}
}
node www02 {
include
2006 Jul 17
6
Rails+Mongrel+Lighthttpd: Ruby-Sendfile Problem
Hello,
I have a working mongrel cluster and want to use Lighty as the frontend
webserver. I want ligthttpd to deliver the static content.
So I did
gem install sendfile --remote
Everything installed.
But if I run the tests like
gem check sendfile --test --debug
i get the following error message:
Exception `Errno::ENOSYS'' at ./test/test_sendfile.rb:75 - Function not
implemented -
2007 May 26
0
New worker not being created
I figured out that in the backgroundrb.yml, I had the old setting of making
the database RAILS_ENV. It wasn''t a valid variable in backgroundrb 0.2.1,
and it wasn''t reporting an error, so I had no idea. Once I changed it to
''development'' or ''production'', it started working.
I found that if a worker has an error, it usually logs the error
2006 May 21
0
Re: log4r and rails
The first question I would ask (partially out of curiosity) is what
log4r specific feature are you trying to use?
While there are some neat log4r features, the built in logger provides
(from my perspective) a good logging framework already probably
addresses most logging needs.
http://wiki.rubyonrails.com/rails/pages/HowtoConfigureLogging
That said, a basic setup to use log4r in rails follows a
2006 May 11
0
File upload works with webrick, but fails in lighttpd 1.4.11
I''ve been trying to add a basic file upload feature (just based on the
Rails Recipes example), but I find that it only works with the webrick
server and not my lighttpd 1.4.11 server.
I''m running Rails 1.1.2 on OSX. The upload silently fails with both
firefox and Safari, even with the useragent hack and with any size of
file/image. My lighttpd config is pretty standard as
2017 Aug 17
3
Can't recursively delete mailboxes
Hi,
This appears to be some sort of dovecot bug. When I use the -r option to recursively delete a mailbox and sub-folders, it removes the sub-folders but not the inbox. It gives me the error below:
doveadm mailbox delete -u denise at lifelinetechnique.com.au -r -s inbox
doveadm(denise at lifelinetechnique.com.au): Error: Can't delete mailbox inbox: INBOX can't be deleted.
Our user
2006 Aug 12
1
Multiple args
Hi
It seems the following code do not transfer multiple arguments to the
worker instance:
controller:
=======
# recipients = Hash
# mailing = Mailing model instance
session[:job_key] = MiddleMan.new_worker( :class => :mail_queue_worker,
:args => { :recipients
=> recipients, :mailing => mailing },