Displaying 20 results from an estimated 400 matches similar to: "RESTful thinking - Need some guidance."
2006 Jul 19
5
Model Validation - with a twist
I''m stuck in a catch-22 type problem. I have an insert form for a table
that uses the validation in the model. i.e. When you click submit on the
form and haven''t filled in the required fields then you get the nice
rails error messages saying "field can not be blank". This works fine
until I introduce some more logic.
What I''m trying to do is to validate
2009 Feb 23
2
geokit - using :through to connect models
hello..
i am currently trying to use :through to attach two of my models
together using geokit. for some reason, i am running into a problem:
ArgumentError: Unknown key(s): as
i have two models, one that is geocoded, and one that belongs to that
model. the models look like:
,----[ employer.rb ]
| class Employer < ActiveRecord::Base
| acts_as_mappable
| before_validation_on_create
2009 Apr 05
2
Prohibit removing INBOX
Hello list,
I'm using dovecot 1.1.11 and I'm going to prohibit users to remove
their INBOX and some other directories in the mailbox root.
I used Access Control Lists (http://wiki.dovecot.org/ACL) to do this:
protocol imap {
mail_plugins = acl
}
plugin {
# With global ACLs in /etc/dovecot/acls/ directory:
acl = vfile:/etc/dovecot/acls
}
/etc/dovecot/acls/.DEFAULT:
owner
2015 Sep 08
3
Multiple vacation
Hi all
I'm using Dovecot 2.2.9 and I'm having problems configuring multiple
vacation actions.
The problem is that I'd like to have two different senders and two
different messages, selecting the correct case by the recipient email
address.
I mean, if someone writes me to my email address "to-address1 at example.com"
I'd like to answer from "from-address1 at
2006 Mar 26
2
Shared Columns in an STI
I have a an STI table which acts_as_tree, that has a large number of
classes/types. My common fields are:
id
parent_id
name
description
with 4 more text fields, I could cover most of my classes if I could
redefine the name of the field like this.
text1 AS address1
text2 AS address2
text3 AS zipcode
For one class and
text 1 AS model_number
text2 AS vendor
Is there a construct that will allow
2006 Oct 13
3
Validation errors in has_one/belongs_to relationships.
I have two objects, QuoteInput and Insured.
QuoteInput has one Insured and Insured belongs to QuoteInput.
I don''t understand what I''m seeing.
I assign an Insured to a QuoteInput. The Insured object has invalid
data.
I call save! on the quote input. QuoteInput has no validations.
I expect two things to happen - 1) an exception should be thrown,
indicating that there was a
2006 Jun 01
3
more questions: human_name
One more question:
Is there some way to set the human_name of a column? e.g.: human_name
for column address1 shouldn''t be Address1 but "Address, line 1".
If not, should I make a hash with my custom names?
Best regards,
--
----------------------------------------------------------------------
Yannick Majoros http://www.inma.ucl.ac.be/~majoros
Informaticien UCL/INMA-MEMA
2005 Dec 19
6
how to do security??
hey, i have maded some security in my website based on
http://www.chaconforcongress.com/accounts/login
Here they work with users, roles and persmission, and they check it like this,
user.has_permission(permission).
I have extended this to: users and groups with roles and permissions.
With permissions like "view records","edit records","delete records",...
def
2008 Mar 19
2
Stub / Mock - A little guidance?
Hi there,
I''m still trying to wrap my head around when to use a stub and a mock.
If I understand this right, I should be using a ''mock'' when imitating
an object, but not its behavior. I should be using a stub when I want
to imitate the behavior of an object. Does that sound about right?
With that said, I''m struggling a little trying to spec out this
instance
2005 Oct 12
4
Validating 2 related models at once not working
Hello,
I have a form that submits data to two related models/tables. One is
Customer the other is Address. Validation for Customer works fine but not
for the Address.
Class Customer < ActiveRecord::Base
has_one :address
validates_presence_of :login, :password, :email
validates_associated :address
end
Class Address < ActiveRecord::Base
belongs_to :customer
validates_presence_of
2006 May 19
2
1 Form for Model containing another Model??
Hi,
I can have a Person model with a "has_one :address_email" association,
then do the following in my controller:
@person = Person.new
@person.address_email = AddressEmail.new
But, when I have 1 form for "Person" in my view I can''t bind fields in
the @person.address_email object with text_field or text_field_tag
helpers without getting a "undefined local
2006 May 27
7
OT Mexican domains?
Hola!
In case there are some mexican readers here...
It is little difficult for an english speaker to find information
about mexican domains. Is it possible to register a domain like
"fiesta.mx"? I have seen sites selling ".com.mx" and similar but not
just ".mx".
Thanks,
Peter
2006 Apr 26
6
get foreign key table data
Hi
I?m trying to bring across all related data.
My table clients has a foreign key field that stores the id of an
organization
How can I grab the details of the organization to use in the clients
show.rhtml file?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2007 Oct 13
4
Chapter 9
Hello,
I''m currently stunk on this issue for few days and I do not know how
to get it fixed.
The system always raises this error message :
order is closed
and here is my order.rb:
class Order < ActiveRecord::Base
include ActiveMerchant::Billing
before_validation :set_status
attr_protected :id, :customer_ip, :status, :error_message, :updated_at, :created_at
attr_accessor
2005 Dec 23
1
pagination problem
hey,
i have this problem
in the database i have 32 records
and the sql filtered 4 records
#getting the callerid records depending on the given paramaters and paginate it
@callerid_pages = Paginator.new self, CallerId.count, 10, @params[''page'']
@caller_ids = CallerId.find(:all, :conditions =>["geotags.firm_id = ? ",
@firm_id], :order => " geotags.address1
2009 Dec 22
1
single host with two different ports
How does one specify two different ports in the same host file? When
lapops are hardwired versus when mobile on a totally different lan.
address0 71.17.72.27
address1 192.168.2.27
port0 22755
port1 655
2006 Apr 26
5
Best way to split forms into steps?
I have a form with about 30+ fields, which the client is wanting to
separate into 3 pages/steps - just wondering what is the best way to go
about this, specifically remembering data entered, from one page to
another, and making sure the various bits of data are validated
correclty, error messages outputted etc etc...
is there a best practice method for doing this?
--
Posted via
2017 Dec 23
0
Hoisting in the presence of volatile loads.
Hello.
This might be a trivial question, but is it correct if the signal handler
aborts the program?
For example:
int *normal = ADDRESS1;
volatile int* ptr = ADDRESS2;
int k = *ptr; // segfaults, and the signal handler calls abort()
int value = *normal; // this may be UB(undefined behavior).
Let's assume that normal is dereferenceable if ptr1 does not raise SEGSEGV,
but accessing
2008 Apr 15
1
How to create static routes on startup with CentOS4?
Hi,
I'm working with the iproute2/iptables toolset on my CentOS4 server to
create custom routing rules. However, I'm a bit at a loss how to create
these permanently so that they are automatically reloaded upon reboot of the
server.
I know that iptables has a config file in /etc/sysconfig/iptables that is
loaded by /etc/init.d/iptables startup script.
Is there anything that works
2017 Dec 20
4
Hoisting in the presence of volatile loads.
On 12/20/2017 1:37 PM, Sanjoy Das wrote:>
> Fwiw, I was under the impression that regular loads could *not* be
> reordered with volatile loads since we could have e.g.:
>
> int *normal = &global_variable;
> volatile int* ptr = 0;
> int k = *ptr; // segfaults, and the signal handler writes to *normal
> int value = *normal;
>
> and that we'd have