Displaying 20 results from an estimated 100 matches similar to: "Tableless ActiveRecord attribute and my aching head"
2006 Aug 16
3
Validate your forms with a table-less model
Ive followed this example of how to validate a form with a tableless
model:
http://rails.techno-weenie.net/tip/2005/11/19/validate_your_forms_with_a_table_less_model
Ive got this example working but when validation fails the failed boxes
are not highlighted in red. At the moment i have a contact details form
and want to validate the information entered by the user but this will
just result
2010 Aug 16
2
Form validation and processing w/o model (no Db/ActiveRecord)
All -
Trying not to fight rails on this, basically have a form and all the same as
would be with an ActiveRecord model except that there is no table. I started
out using this article:
http://stackoverflow.com/questions/315850/rails-model-without-database
...which is kind of a hack by inheriting ActiveRecord in to non-AR model but
am running into some problems and just have the feeling that I am
2006 Jun 27
4
Not Active Record Model Validation
I have a problem with ruby on rails validation
total_book_toy.rhtml
================
<%= text_field ''book1'', ''title1'' %>
<%= text_field ''book2'', ''title2'' %>
I want to validate these text_field so user can''t insert same title.
However, I was stuck how to do it.
Or maybe you have another way how to do it.
2006 Feb 05
0
Enum patch for Rails
Hello!
I''ve modified ActiveRecord a bit to support enum columns. This is tested
only with MySQL, and maybe needs some changes for other adapters (if
they use another syntax or quoting style).
I believe this patch should be tested well, so I haven''t (yet) tried to
post it to the official Trac. It is also not solid-as-a-rock when it
comes to quoting ENUM values.
After
2006 Mar 01
5
validations without AR - going crazy trying to find link
Hi,
in the past few months someone posted an entry on their blog about
how to do validations in non-AR classes and I cant find it any more.
Anyone have a link?
Thanks,
Trevor
--
Trevor Squires
http://somethinglearned.com
2007 Aug 24
0
ArgumentError: interning empty string and enum-column plugin
Hello,
I am a developer who has just started working on a large scale
website in a team of 5 other developers. One of the developers has
introduced some enum columns into the the database. Now, by default,
active record doesn''t support enum column types but I have added the
enum-column plugin into our project. This has worked very well except
for a few instances where he
2006 Aug 02
3
Active Record
I want to build a one page finance calculator in Rails.
The form has several fields on it. When I press the calculate button
it will return to the same page with the answer. If there is an error
it will also return to the same page with the appropriate error
messages.
I want it to be able to
1. Carry over all the values on the form fields
2. Use the rails validation methods
How can I acheive
2008 Dec 05
1
ActiveRecord Oracle and nvarchar2 or nclob datatype
Hi,
I ve got oracle database which exists prior to my rails app... :-(
I ve got trouble when I am updating/inserting records of a table which
includes nvarchar2 attributes.
These have a specific maximum length.
I often get an error Value too long for column when doing my inserts/
updates, but in fact that is not the case.
I ve taken a look at the generated sql statements....
As far as I know
2006 Sep 09
1
Getting Valid ENUM Values in ActiveRecord
I know that Rails doesn''t handle database ENUMs. I''d say that 9/10, you
can get away with just using varchar instead. However, there ARE
instances where you need certain functionality that ENUMs provide (ie:
integrity at the datalevel).
I have a working function that will show what enum types are available
for a certain column in a table (I believe this will only work for
2006 Apr 26
4
Re: Rails AR/Oracle Unit Test: [4280] failed
The revised patch submitted on #4748 broke the build, I''m looking to
sort out why.
Also note that this auto-test email didn''t make it to rails-core because
it was too big (every test failed, so the resulting email was huge).
I''ll patch my auto-testing script to truncate the email to no larger
than a few kb.
Michael Schoen wrote:
> "marcel" made
2007 Mar 17
4
Created_on and updated_on in a non-ActiveRecord model
Hi you all,
I have a model simulating an ActiveRecord model, according to the tips
stated in [1]. It is simulated because even though I am gonna save the
attributes in a file, not in a DB, I still want the validations made by
ActiveRecord::Base (see code below).
Well, the thing is that I also want the behaviour of the created_on and
updated_on columns, that get modified automatically before
2007 Sep 03
0
Change the datatype of an attribute?
Hey everyone
I''m building an application that is using a mySQL SET datatype sad
The problem is that ActiveRecord thinks this is a date! Here''s the
relevant output from Model.columns:
#<ActiveRecord::ConnectionAdapters::MysqlColumn:0x351b488
@primary=false, @scale=nil, @sql_type="set(''Any'',''Grade School'',''High
2008 Feb 20
0
Unicode Support for MS SQL Server
In order to coerce Rails 1.2.x into supporting Unicode values for an
attribute in a model, I found I had to do the following:
1) Change the underlying column type from varchar to nvarchar.
2) Prepend any quoted values going into nvarchar columns with a
capital-letter-N, e. g. ''unicode'' becomes N''unicode'' In order to
accomplish this, I modified
2006 Jul 08
1
Need Help Understanding Situation with Table Columns
I am trying to create an application loosely based on the Depot application
presented in Agile Web Development with Rails (AWDwR). I am using InstantRails
for the server. In my app I have the folowing controllers:
admin_controller
application_controller
city_map_controller (with method: displayGMap)
The admin_controller was created with the following command:
ruby script/generate scaffold
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id''
I have a Model class like the following:
class Article < ActiveRecord::Base
set_primary_key "ARTICLE_ID"
end
however, using a link_to like the following (modified scaffolding),
the link has no id value:
<% for article in @articles %>
<tr>
<% for column in
2007 Feb 25
8
Double-banger function names: preferences and suggestions
What do you prefer/recommend for double-banger function names:
1 scale.colour
2 scale_colour
3 scaleColour
1 is more R-like, but conflicts with S3. 2 is a modern version of
number 1, but not many packages use it. Number 3 is more java-like.
(I like number 2 best)
Any suggestions?
Thanks,
Hadley
2006 Jun 11
1
Activerecord attribute without db column
Hi,
I''ve a model that is stored to the db, but just one of its atribbutes
doesn''t have a corresponding column on the table (it is used just for a
calculation and still requires validation).
I''ve been succefull by doing what is explained in
http://rails.techno-weenie.net/tip/2005/11/19/validate_your_forms_with_a_table_less_model
But I get an error of a non-existent
2006 Feb 05
1
1 ISDN BRI to IAX2/SIP... (*) best tool or?...
I have a question,
I have to provide a solution for an office that will be almost abandoned,
and there will be one or sometimes two persons 2 days a week. The main
number however should be preserved.
They have several ISDN BRI connections, most of which will be dropped.
Only one will be retained, for 2 reasons:
1) It has the ADSL link
2) The number has been the main contact number for over 20
2006 May 22
1
New to rails, looking for some advice re: migrations
I''m trying to get started with Rails, but I''m running into a few places
where I''m having trouble understanding the expected workflow.
I''m trying to work with migrations from the beginner; its a port of an
existing application, but I''d like to let the db schema evolve as the
application grows, so I''m starting from an empty (tableless) database.
2007 Apr 24
1
Kerberos stopped working
Hi everyone,
I am in a real panic here and would appreciate any help.
I have students not being able to save any files!
I have a samba server that was joined to a win2k active directory and running for months.
I dont know why, but now it isn't working correctly.
This error is filling my logs:
-------------------
libads/kerberos_verify.c:ads_keytab_verify_ticket(113)