Displaying 20 results from an estimated 2000 matches similar to: "validates* gives me problems"
2006 May 04
2
validates* give me problems
Hi All,
I''m newbie to this tool and following some tutorials I''ve came across
with this problem when configuring my webpage:
In Debian/testing, ruby1.8, rails1.1
I create my audio application which connects to a database (mysql) named
audio with tables:
articulos(id,titulo,descripcion,created_on,categoria_id) and
categorias(id,titulo)
after creating and modifying the
2006 Apr 28
6
SSL and url_for
Hey, all!
I''m having a url problem that seems like I''m going to overcomplicate
it if I don''t just ask what I''m doing wrong...
My situation is that I''m testing to see if a visitor is accessing a
controller via SSL, and if not, redirect to the same controller via my
secure address. This really only amounts to replacing http with https,
and so I did the
2006 Apr 28
3
Handling errors - incorrect value entered in url...
I have many "edit" actions in my project. If the url is like
http://localhost/project/3/edit and someone enters
http://localhost/project/3333333/edit the edit action will fails because
it cannot find a project with id of 3333333.
To combat this I am adding to every action like edit:
rescue
redirect_to :action => ''index''
flash[''errors''] =
2006 May 01
7
ActiveRecord and Database Views
Hiall,
If I have say 10 tables that i would like to wrap up in 1 view to
manipulate data inside these tables, do I then need 10 model.rb files
for all 10 tables plus 1 for the view, or do I just need 1 model.rb
file for the view ?
cheers
Martin
2006 Apr 29
2
nuby migration question -- data migration, MySQL => postgresql
How do I best migrate the data? For small databases I can text-edit the dump file from
MySQL. The postgresql compatibility switch doesn''t help on mysqldump. Any ideas. Can
MySQL export CSV that postgresql can import ?
W Fred
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Apr 29
5
Getting Session ID
I thought I understood how to grab the session id but in the following
code I am getting null for the session id:
@foo = Foo.new(:session_id => session[:session_id],
:test_id => @test.id)
--
Posted via http://www.ruby-forum.com/.
2006 Apr 30
16
postgresql duplicate key violates unique constraint
I have a weird problem with creating a new record when using PostgreSQL.
From inside script/console ...
>> entity = Entity.new
>> entity.first_name = "Foo"
>> entity.last_name = "bar"
>> entity.save
Throws an exception due to the following SQL error: duplicate key
violates unique constraint.
The application was working fine before and suddenly
2006 May 18
7
Ruby Before Rails
As I, like many people, are coming to ruby in the rails era, I''m curious
about how Ruby Web Dev was done prior to rails. Any veterans want to
share their insights?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060518/20cde24d/attachment.html
2009 Jun 17
2
validates_uniqueness_of fails on STI in Rails 2.3.2
I''ve got something like this:
class Position < ActiveRecord::Base
end
class CartItem < Position
validates_uniqueness_of :product_id
end
When I try to save CartItem I get this error:
ArgumentError: wrong number of arguments (1 for 2)
from
/home/joaz/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:758:in
`exists?''
from
2006 Apr 27
12
Stealing users IP address
Is there a functiaon to take the IP address of person who submits to a
form
example:
<input id="user_ip" name="user[ip]" type="hidden" value="<%=
some_ip_call %>" />
--
Posted via http://www.ruby-forum.com/.
2006 Jun 08
7
The Agile Book Messageboard?
Hello.
Where is there an Agile Messageboard?
On the first part of the Depot example, a price field shouldn''t be an
integer right? (it should be more of a float since a price has decimals)
Dominic Son
--
Posted via http://www.ruby-forum.com/.
2006 May 01
10
large file storing in postgres sucks?
Hi,
I''m not sure if this is a postgres issue or not, but I''m using
Postgres 8.1. I have (in my functional tests) the following code:
upload = fixture_file_upload(''/files/podcast.mp3'', ''audio/mpeg'')
post :create, :product => valid_product, :media => { :image => upload }
And then in the controller:
blob = Blob.create :data
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
I submitted this earlier, but the web forums went down and I''ve screwed up
the thread, so I''m starting over.
I''m trying to built a document upload system. The system has a main
Document model with different subclasses for different types of documents.
With the code below, if I attempt to create a Document, it works fine, but
if I attempt to use one of the subclasses, I
2006 Apr 27
2
postgresql ruby rails connector ?
Which postgresql gem or library are people using on windowsxp for rails? And what do I
put in the yaml file?
Warren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060427/e68daff3/attachment.html
2006 Apr 30
2
Give me NIL or null results
with this post; with a query with multiple tables, I am trying to return
results that are null in one table; I am trying to do something like this;
class NumbersFeedLink < ActiveRecord::Base
has_many :numbers_sent_feed_link
end
class NumbersSentFeedLink < ActiveRecord::Base
belongs_to :numbers_feed_link
end
sent = NumbersFeedLink.find(:all,
:order => [
2006 May 21
12
TDD for Rails book?
It seems like half the people on this list are writing a book on Ruby
or Rails. For all the hints I''ve seen strewn across the list I have
yet to see one that will focus on test-driven development for either
Ruby or for Rails.
If anyone is looking for a topic, please consider this. I''ve been
trying to wrap my brain around the TDD process, but its way of
thinking is
2006 Apr 28
19
Remember James McGovern?
Remember James McGovern and his articles about Rails and enterprise?
Well... Check this one out where he "puts his money where his mouth is"
http://duckdown.blogspot.com/2006/04/ruby-community-proved-mcgovern-wrong.html
--
--------------
Jon Gretar Borgthorsson
http://www.jongretar.net/
2006 Jun 09
2
Deployment Suggestions
Did a quick search, but didn''t come up with anything definitive.
So what does everyone think is the best low maintenance and most hassle
free way to go for deployment? Is lighttpd still everyone''s choice?
I remember seeing one that was a pre-packaged environment with apache I
think. Anyway, just about to deploy an app and thought I''d ask
suggestions - want to see
2006 Apr 23
3
Validates_presence_of in ActionMailer model
Hi all,
I want to submit the content of a form by mail.
I don''t want to save it into a DB.
How can I validates the content of this form with validates_presence_of ?
Thank you.
Damien
2006 Apr 26
1
Observer best practices
I''ve seen two ways of connecting observers:
1) In the observer class put
observe MyModel
2) In the controller class put
observer :my_observer
What is the difference between these two? Also, is it necessary to put
in the observer class the following?
MyObserver.instance
Jose
--
Posted via http://www.ruby-forum.com/.