Displaying 20 results from an estimated 23 matches for "jeremyevans0".
2006 Jan 27
6
Scaffolding to use has_many and belongs_to ?
What does everyone on this list think about enhancing scaffolding
somehow so that a "has_many" relationship will automatically drop the
<select> box into the view to reference the "belongs_to" part of the
view?
I think scaffolding is great but I am always adding the <select> boxes
to reference the parent association. Do you think this would be
useful? just a
2006 Mar 28
5
combining two models in one controller/view "set"
I''m going to take another stab at this question (my first one received
no replies):
I have two models:
Author
has_many: books
Book
has_one: author
I have two tables:
authors
id
...
books
id
author_id
...
I let the scaffolding fly and it created the CRUD goodness for each
model, as expected.
However, I want to have only one view/controller "set" for both
models; when I
2010 Nov 20
6
unicorn 3.0.0 - disable rewindable input!
Changes:
Rewindable "rack.input" may be disabled via the
"rewindable_input false" directive in the configuration file.
This will violate Rack::Lint for Rack 1.x applications, but can
reduce I/O for applications that do not need a rewindable
input.
This release updates us to the Kgio 2.x series which should play
more nicely with other libraries and applications. There are
2006 Jan 17
8
Next Record
Okay, I know this will probably be a very easy question. But I am
discovering that RonR makes just about everything easy. The problem is,
it takes me a few hours to figure out that I can do it the easy way.
I need to know how to move to the next record in a database. I want to
format my out put in a table. For example, I want a 3 by 3 table. So
record one goes in the first cell, record
2006 Jun 05
7
":database_manager =>CGI::Session::MemoryStore" doesn''t work properly...???
Hi,
We are try to use the "database_manager
=>CGI::Session::MemoryStore" for the session
management. our website has a lot of "redirect_to".
while the website is running under webrick, everything
is fine. But when we run the system under
aprache/fcgi. the redirect_to seems doesn''t work
anymore with the option "MemoryStore"
does anyone have the same
2006 Jan 12
3
Introspecting Active Record Associations
Hi,
I''m looking into write scaffold generators that will, amoung other
things, scaffold active record associations (eg. generate select
boxes for belongs_to where you can choose a parent object) for quicker
prototyping. But...
My question is: Is there anyway of finding out what associations
exist from examining the lodel classes themselves or indeed any other
way of finding out this
2006 Feb 28
3
[AR] #{id} namespace visibility used in finder_sql
Dears,
[Rails 1.0.0]
I''m working with a legacy schema, and around my 20+ models i''ve used
some AR constructs.
They are based on a finder_sql doing some dirty sql and using #{id}
from the ''pivot'' model for extracting data in other tables.
like :
class Division < ActiveRecord::Base
set_table_name "legacy_division"
set_primary_key
2012 Jul 18
5
Any comment on adding #cast and #cast! to ActiveRecord::Relation?
Not getting any love (tender or otherwise) on my pull
request<https://github.com/rails/rails/pull/7035>so I thought you
folks might like to chip in. What do you think?
#cast and #cast! allow you to declare a mapping from generated column names
to simplified
database column types (i.e. those used in migrations). This way scopes with
columns generated in their select lists can also include
2011 Jun 16
7
[PATCH] replace fchmod()-based heartbeat with raindrops
This means we no longer waste an extra file descriptor per
worker process in the master. Now there''s no need to set a
higher file descriptor limit for systems running >= 1024
workers.
---
I just pushed this out to git://bogomips.org/unicorn.git and it''ll
be in Unicorn 4.x.
The subset of raindrops used by Unicorn should work on all machines
with mmap(2) +
2006 May 24
5
rxml vs rhtml
I have been wondering if anyone here knows which format is faster for
your templates? I am curious cause in the near future I may be using
some expensive scripts (timewise) and would like to try and squeak out
as much performance as possible. Is Ruby like other languages (ASP
classic for example) that inccur a penalty by switching between HTML and
Ruby Code?
Ben
--
Posted via
2006 Feb 23
8
SQL quoting for :order parameter
When I construct a query using variables I do something like this:
@users = User.find(:all, :conditions => ["location = ?", location])
I would like to do the same sort of thing in the :order parameter.
@users = User.find(:all, :order => ["? ASC", location])
When I try this though I get a SQL error and I see that the items in the
array were concatenated together and
2006 Jan 09
6
Nil column results, possible to ignore?
For a table "clients" there are city, state, and zip fields. However, for some clients we only have a state with no actual address.
The following code throws a "You have a nil object" error when outputting my client list. Is there a way around this, short of writing a specific case for each possibility?
<%= client.city + '', '' + client.state +
2005 Dec 14
5
belongs_to and multiple foreign keys
Hi all,
I''m confused about how I''m supposed to specify a belongs_to relationship when
the table includes multiple columns that reference the same parent table.
In my case I have a "schedules" table with "opened_by" and "closed_by" columns,
that both reference the "users" table. In theory, they can be two different
user ids.
table
2006 Nov 02
2
Rescue don't work on web applications
Hi,
I''ve a Rails application who starts a Ruby script .
The script is made via Web -> database.
Than you can select a script to start via a database list.
Problem:
In case of errors , I like to start a rescue showing the users the
problems.
render(:text => "<pre>" + CGI::escapeHTML(`
begin
/home/luc/radrails/cpe/public/startq_test.rb
2006 Jun 21
5
model with not te be updated attributes ?
Hi List,
I have a table that contains several fields that must be initialized
when first created, but may not be altered afterwards (when updating the
other fields) because they can be changed by external processes.
I noticed that the ActiveRecord update commands (even update_attribute)
only seem to work by loading the complete record, changing fields that
need to be changed and doing a full
2006 May 19
4
Lookup tables and scaffolding
It occurs to me as a missing feature that there''s no way to indicate a lookup
table relationship (as opposed to other sorts of foreign key relationships)
in Rails and that the scaffolding generator could recognise this lookup and
render a drop-down list automagically for the lookup table.
Say you have an Address and a State, and the State is a lookup table. In
addresses you have
2006 Dec 08
19
HABTM join table quirk
I''ve been bringing up a good basica framework for applications at work.
To give decent security I''ve been implementing the Rails Recipie for
Authorization of function calls modeled on the book''s implementation.
(Changes for our environment were added..but are minor.)
Since I initially let Rails create the join table between two data
tables with a HABTM relationship....I
2006 Jun 21
11
executive: "is rails secure?"
Yesterday, I was doing a dog-and-pony for the head of the company that
I work for.
He asked, "Is this (a rails application) secure?"
I said, "It''s as secure as anything else on the web is," and proceeded
to talk about how the data was protected, how we weren''t saving
anything that''s worth protecting, and so on.
I''d like to have a better
2006 Mar 15
10
Scaffold with Foreign Key
I have two tables:
------------------------------
drop table if exists users;
create table users (
id int not null auto_increment,
username varchar(100) not null,
password varchar(20) not null,
firstname varchar(20) not null,
lastname varchar(20) not null,
primary key (id)
) TYPE = InnoDB;
------------------------------
drop table
2006 Jul 27
0
Why is false.blank? => true ?
When using a boolean attribute, often you want to insure that it has a
value that is either false or true, but not null. One would think
that "validates_presence_of :boolean_attribute" would work for such a
purpose, but it does not, because false.blank? => true. I''m guessing
this is the expected behavior, but I''m wondering about the rationale.
blank? would imply