similar to: how do set default value for ActiveRecord fields?

Displaying 20 results from an estimated 4000 matches similar to: "how do set default value for ActiveRecord fields?"

2006 Nov 07
5
mechanize: 400 Bad Request
Hello, when trying to access a certain HTML-frame, I get: "in `request'': Unhandled response (WWW::Mechanize::ResponseCodeError)" and the page returns: "400 Bad Request" * Why? * How to solve this? With browser, it works. In the logs below, I marked 4 lines with "***", where I see possible differences in the URI. But I don''t know, if this is
2006 Apr 12
22
Dynamic Select Box
Hi, I''m new to rails/ruby having come from PHP and am just starting to get my head round how easy it can be :) However, can anyone point me in the right direction for dynamicaly updating a select box based upon the choice of a previous select box, without a page refresh. Any and all help greatly appreciated. Thanks -- Posted via http://www.ruby-forum.com/.
2006 May 03
4
default values
Hello, I''m working with a postgresql table CREATE TABLE elements ( id serial primary key, c1 text default f1(), ... cN text default fN() ); But if I use de lines @element = Element.new @element.save the values that element take are the nextval in the id field and nules in all the other fields. How can I get the defaults? (but without rewriting the
2005 Dec 19
3
Is there a list of html_options for the FormOptionsHelper?
I''m looking for a way to select a default value from a select box, like this: select("user", "role_id", Role.find_all.collect {|r| [ r.name, r.id ] }, { :default_value => ''5'' } (of course, there is no ":default_value") If the form is being used on a ''create'' page, it should display a default in the select box. If
2006 Jun 06
1
Default value plugin
I''m releasing a very small plugin that allows you to specify default values for fields in models. Ordinarily, you might do this in your schema, I guess, but then it''s awkward if you need that on a serialized field or need your default values calculated somehow. So you can do something like this: (repeated from an earlier post and the README) class Mixture <
2010 Feb 02
3
[LLVMdev] jit X86 target compilation callback bug
Hi! We are running llvm jit x86 on MS Visual Studio 2005. It seems there is a bug in asm code in function X86CompilationCallback in file X86JITInfo.cpp. Current code sets stack pointer to invalid value in instruction "and esp, 16". Depending on current stack pointer value it sometimes overwrites ecx and edx registers with next three lines. We have fixed this problem by changing this
2006 Jun 01
3
rake create_sessions_table, does not create session table
when i run rake create_sessions_table, I get following output. tables donot get created and my application doesnot start. (in G:/rubysrc/blog) create db/migrate create db/migrate/001_add_sessions.rb info: the first time ran take everyting was fine, but now i have reinstalled ruby and rails and created the database, but i am unable to create session table with rake, please help.
2008 Feb 21
7
looping through a list
what is the proper way to loop through a list in a rails view (assuming that you need to check if it is empty or not) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2010 Feb 02
0
[LLVMdev] jit X86 target compilation callback bug
Hello > We are running llvm jit x86 on MS Visual Studio 2005. It seems there > is a bug in asm code in function X86CompilationCallback in file > X86JITInfo.cpp. Current code sets stack pointer to invalid value in > instruction "and   esp,  16". Depending on current stack pointer value > it sometimes overwrites ecx and edx registers with next three lines. How so? The stack
2006 Jul 24
3
HowTo?: Eager caching of third order ActiveRecord assoc.
Hello. Using the ":include", which generates a "LEFT OUTER JOIN" SQL command, it is possible to eagerly preload second order data objects (children) for a given association. I wanted to know, if it is possible to eagerly preload and cache third order (or more) data objects, which are little-children or little-little-children. As I''ve seen. it is possible to add
2010 Jul 11
1
difficulty with R expressions in text/legend
hi, i'm trying to prepend some plain (i.e. unevalutated) text to a typographically evaluated R expression in a legend(...) call. here's a working legend(...) call that is close to what i'd like (where x and y are returned from an lm(...) call): legend("topleft", legend = c(bquote(R^2 == .(summary(x)$r.squared)), bquote(R^2 == .(summary(y)$r.squared))), fill =
2010 Oct 01
3
scoping goes wrong when some functions are used within others.
Dear, I'm following the r tag on stackoverflow.com, and couldn't but notice there are quite some questions popping up that deal with scoping in relation to custom functions. I grinded my teeth on it already, and I have absolutely no clue what goes wrong. The general pattern is as follows : ff <- function(x){ y <- some_value some_function(y) } > ff(x) Error in eval(expr,
2006 Mar 27
3
Migration commands -- create a SQL Server production DB?
Hallo -- could anyone tell me how I use Migrations (which my existing development schema is implemented with) to create the production database for deployment? The target DB is a SQL Server database -- I don''t know if that''s an issue -- I seem to remember reading that SQL Server is supported now. Oh, yeah -- SQL Server was *not* my choice! But what I seem totally unable to
2007 Jun 11
5
string conversion?
Hi there! Is it possible to do something string converison like in puppet? My problem: I have a variable that contains a path ($variable = "some/value"). This variable is passed on as an option to an external script, which uses the variables content to generate I) a path and II) a filename, converting the "/" to "_" for that filename. I don´t really see a way to
2006 Jan 25
2
Setting up deployment scenario
I am familiar with using RoR in a pure development environment, that is to say that I can create a local project, access it via a web browser, update the database, etc. However, I''m having trouble figuring out how to best set up things with actual deployment in mind. Forgive me if this has been asked before, I couldn''t find it easily. Right now I have a subversion repository
2011 Nov 22
4
Data Frame Search Slow
Hey All, So - I promise to write a blog post on this topic and post it somewhere on the internet once I get to the bottom of this. Basically, the set-up to the problem is like this: 1. I have a data frame with dim (2547290, 4) 2. I need to make SQL like lookups on the dataframe. I have been using the following sort of syntax: a.dataframe[a.dataframe[[column_index]] %in% some_value, ] 3.
2006 Feb 26
1
Migrations: column option "offset"?
Hi, On the wiki http://wiki.rubyonrails.com/rails/pages/UnderstandingMigrations it says: Valid column options are: - limit - offset - null (i.e. ? :null => false? implies NOT NULL) - default (to specify default values) I was wondering what the purpose of the "offset" option is. And after looking at the API at
2006 Jul 20
11
Any good alternative to single-table-inheritance?
I''m looking to implement model inheritance in a new application. Is there any good alternative to single-table-inheritance? -- -Alder
2002 Sep 23
1
calling a DLL/shared lib from R directly?
Is it possible to call a basic function/subroutine in a DLL/shared lib from within R without having to build an R package? I have a function like: void __stdcall testfunc2( unsigned long a, double b, unsigned long c ) { return a * b * c; } or=20 subroutine fortran_2002_bh_age (sp,site,total_age,bh_age) integer*2 sp real*4 site=20 real*4 total_age integer*2 bh_age
2006 Aug 14
5
UML
In Rolling with Ruby on Rails tutorial - http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html - I saw that to introduce a new element to my domain, I needed to define it in a table, generate a model element with a similar name and the class would autoamtically take the attributes from the table definition. Is it possible to do this in the other direction... i.e to take the class diagram