Displaying 20 results from an estimated 3000 matches similar to: "Where to place custom classes?"
2005 Mar 06
4
has_many and order
Hi all,
if I have a has_many and belongs_to relations like this
category has many articles
article belongs to category
is there a way I can specify the order of articles when pulling them up
with
@some_category.articles
?
Many thanks in advance!
-- Nicky
2006 Jan 24
17
Updated lighttpd to 1.4.9 - error running dispatch.fcgi
Hi all,
I just updated lighttpd from 1.4.8 to 1.4.9 and it now refuses to
start with the following error:
2006-01-24 23:12:24: (mod_fastcgi.c.989) execve failed for: public/
dispatch.fcgi No such file or directory
2006-01-24 23:12:24: (mod_fastcgi.c.1015) the fastcgi-backend public/
dispatch.fcgi failed to start:
2006-01-24 23:12:24: (mod_fastcgi.c.1019) child exited with status 2
2006 Feb 01
4
Custom view helpers
Hi all,
I would like to write some custom helpers like the ones available as
form helpers text_field, text_area and the like. My first try was this:
custom_helper(obj, meth)
''some_string'' + obj.send(meth) + ''some_other_string''
end
Object and method are being passed as symbols like this:
custom_helper(:person, :name)
and Ruby rightfully complains that
2005 Dec 26
3
Override Validation?
Hi all,
is there a way to override the validation methods so as to avoid the
div.fieldWithErrors divs from being created on the redisplayed form?
Many thanks in advance,
Nicky
2006 Mar 08
2
Multilingual Validation Messages
Hi all,
I have a mutilingual app and want to customize the validation error
messasges. I cannot override them as I need them in more than one
language, so I have done the following:
validates_presence_of :some_attr, :message => _(''should not be blank'')
I am using gettext to translate the message.
This works in development mode, but not in production, even after a
2006 May 08
2
Associating with different classes
Dear Railers,
I am toying with a new project and have a schema design question.
I have a tree-like node structure. Each of the nodes will be
associated with a single object. This associated object can be of a
variety of types.
I represent the tree through a Node class which acts_as_tree. Now
imagine three other classes--Animals, Fruits and Vegetables. Each
node will have an association
2005 Dec 25
2
Caching of models?
Hello, people!
I have a problem. I googled, asked for help on IRC. I can''t find an
answer. Suppose I have model Cart (from "Agile Web Development with
Rails"). I added call to logger.warn("Some warning") to one of it''s
methods. It fails with NameError, because ''logger'' is unknown to
model.
undefined local variable or method
2006 Jul 28
15
Store/product stock design question
Hi all,
I''m having trouble figuring out how to handle stock levels in a new
store I''m building. When products are entered into the admin of the
store, they have a stock number associated with them.
What I''m not sure about, is how I go about maintaining this stock
level. Take this scenario:
1. User A adds an item to their cart, and I check that it''s in stock -
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
2006 Apr 04
1
sessions failing on debian apache2 fast_cgi
Hi All,
So I just pushed our rails app to our production server, but I''ve
encountered a number of problems.
Firstly the fast_cgi processes seem to be eating up a hell of a lot of
memory, at times max out our 1gig of RAM. I''ve switched back to cgi for
the moment, but independently of that sessions seem to be failing
intermitently.
The session will hold itself stable for a
2007 Oct 17
9
@session['user'] vs session[:user]
This might seem really simple to some but just wanted to ask: what is
the difference between @session[''user''] and session[:user] ? and how
would you use each?
And another question, I have the following code:
def get_customer
if @session[''customer'']
@c = Customer.find(@session[''customer''])
end
end
private
def
2007 May 30
2
Depot - empty_cart with ajax
First of all id like to say hi to everyone from Argentina, im yet
another Depot first-timer.
Going through the example, i got to the point where my cart finally
runs Ajax-based. And there is a line where Dave says, after all the
job is done "You should see the cart in the sidebar update. And you
shouldn''t see your browser show any indication of reloading the page.
You''ve
2005 Dec 21
1
RE: Prototype: correct useage of onCompletewithAjax.PeriodicalUpdater
The only call that PeriodicalUpdater will make periodically to you is
the insertion call.
I think of onComplete as being ''I''ve done everything I was going to do'',
which for Updater is right after it''s done a single update, but for
PeriodicalUpdater, it''s after it''s finished all of its updates, so
you''ll only get it once for any call
2006 Apr 27
6
Why not mod_ruby?
Hi!
I''ve understood that the mod_ruby apache module is not recommended for
running Ruby on Rails applications. But I haven''t found any information
as to why that is so. Please enlighten me. And could you point me to the
(currently) prefered production environment. (That can handle both RoR
and PHP sites).
Thank you and best regards
Hans-Eric Gr?nlund
--
Posted via
2012 Mar 02
3
download.fedora.redhat.com down? moved?
Hello all,
I'm trying to install mod_python from the normal channels via RPM,
though it seems that download.fedora.redhat.com is down, or moved?
DNS reports it does not exist.
I've seen multiple references to this domain name including on the site:
http://rpm.pbone.net/index.php3/stat/4/idpl/15286937/dir/redhat_el_6/com/mod_python-3.3.1-14.el6.1.x86_64.rpm.html
Please help?
Thank you,
2006 Jan 24
4
Can R handle medium and large size data sets?
Dear R experts,
Is it true that R generally cannot handle medium sized data sets(a
couple of hundreds of thousands observations) and threrefore large
date set(couple of millions of observations)?
I googled and I found lots of questions regarding this issue, but
curiously there were no straightforward answers what can be done to
make R capable of handling data.
Is there sth inherent in the
2008 Oct 24
4
Railscast 75, Observe_field and Shopping Cart
Hi all,
I have the shopping cart page where a user can add items dynamically
through ajax as explained in Railscast episode 75. I am using
observe_field to observe the ''quantity'' and ''cost'' fields to update
the total field for each item.
This does not work however, for records that are added through the
Ajax. How can i name the fields and observe them as i have
2006 May 25
2
Design question
Hi,
I am really enjoying the experience of writing my first web app in
Rails. I particularly like the instant feedback the framework offers
when developing in small increments and I am learning new things all the
time. However since I develop alone and my inexperience with rails I?m
asking for help to answer some design questions that I have regarding my
first app.
After reading the Agile
2007 Aug 28
1
flintlock fork causes hang in Apache+Python+mod_python
I am trying to use Xapian 1.0.2 with the Python SWIG
bindings withn an environment consisting of Apache
httpd with mod_python. (not as a CGI) Also this is
Linux.
Whenever the python code attempts to open a database
the entire httpd process will hang indefinitely. The
python bindings work outside of the apache/mod_python
environment.
>From the best I can tell the hang occurs in
2006 Mar 09
13
Apache or lighttp for Ror/2003server?
160,000 pages
99% static, only minor stuff done in rail (search, contact us, etc.)
windows server 2003
Ror 1.0
Currently 30K Hits /day on IIS.
Apache or Lighttp? Fast_CGI seems kinda slow with a 2003/Apache
configuration.
The only thing I''ll get rid of for sure is IIS.
-Cedric
--
Posted via http://www.ruby-forum.com/.