Displaying 20 results from an estimated 70000 matches similar to: "Access table names"
2007 Nov 27
2
Getting table field names from an object
If I had the following
@recipes = recipe.find_all
Is there a way to find all the field names returned by the query and the
data in them.
Thanks
Martin
--
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
2009 Mar 10
5
'unknow column error' when using include and associated table condition in find
Here is my weird problem.
Two models like following:
Lexeme
id:int
name:string
Structure
id:int
ref_id:string
meta_id:int
Lexeme can have many structure records through foreign key ''ref_id'' in
the structures table.
And these structure records belonging to one lexeme differs between
each other using meta_id.
And if Lexeme has structures, then there must be a top_struct whose
2010 Sep 16
5
vestal_versions -- can I set it to ignore certain columns?
I''d like my published boolean to be excluded from the calculation as
to whether a version is created or not. Can anyone suggest a way to do
that?
Thanks,
Walter
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To
2008 Mar 08
9
Newbie worries with "Developing Rails Applications on Max OSX Leopard"
Hello There,
As a new comer to RoR, I started to follow the article
http://developer.apple.com/tools/developonrailsleopard.html. In short
you create to entities and one one-to-many relation linking them.
Everything was good until the establishment of the relation. I am
unable to go any further than "Linking Models Together" : I can create
the "vendors" mentionned in the
2006 Dec 27
10
Mixing html tags and Ruby blocks
I''m trying to get the following idea to work:
<%= @column_names.each { |t| <td> t.downcase </td> <td>
@listing.send(t.downcase)</td> } %>
Essentially I want to display a form that has a left and right TD, with
the left TD being a column name and the right TD being the column data.
If there''s a better way (the Rails way ?), I''m all ears
2007 Jan 10
2
Get fields in a generator
I am making a generator, and I want make a partial form with all columns
the of table. How made for get count of columns, and how made for get
each columns, and also to show the name of column?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2007 Oct 24
7
NoMethodError when creating new ActiveRecord model object
the strangest thing is happening...i''m not getting this every time,
maybe 1/3 of the time, identical requests...
i''m a rails newbie, but i think i''m trying pretty standard stuff, this
is an excerpt from the log:
----------------------
Processing EmailConfigsController#edit_xml (for 127.0.0.1 at 2007-10-24
15:52:09) [GET]
Session ID: 6630219819a2da423d8c48a259dd28d6
2007 Oct 15
6
SQL injection with :order, :limit, :group
I know how to avoid SQL injection attacks when you use :conditions
User.find :first, :conditions => ["login=?", params[:username]]
but how about with :order, :limit or :group?
# uh-oh...spaghetti-oh
User.find :first, :order => "login; delete from users; select * from users"
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2012 May 16
2
confidence intervals for nls or nls2 model
Hi all
I have fitted a model usinf nls function to these data:
> x
[1] 1 0 0 4 3 5 12 10 12 100 100 100
> y
[1] 1.281055090 1.563609934 0.001570796 2.291579783 0.841891853
[6] 6.553951324 14.243274230 14.519899320 15.066473610 21.728809880
[11] 18.553054450 23.722637370
The model fitted is:
modellogis<-nls(y~SSlogis(x,a,b,c))
It runs OK. Then I calculate
2009 Mar 01
1
Strange behavior of Source.column_names
I have a class named Source and a controller named SourceController
etc.
When I use Source.column_names in the view all names except names
ending in _id is listed, although according to the documentation all
names should be listed
When I use Source.column_names in the source controller it lists
correctly all names also the ones ending in id.
When I first call Source.column_names in the
2007 Jun 08
1
How to make a table of a desired dimension
Hi ComRades,
I want to make a matrix of frequencies from vectors of a continuous
variable spanning different values. For example this code
x<-c(runif(100,10,40),runif(100,43,55))
y<-c(runif(100,7,35),runif(100,37,50))
z<-c(runif(100,10,42),runif(100,45,52))
a<-table(ceiling(x))
b<-table(ceiling(y))
c<-table(ceiling(z))
a
b
c
will give me three tables that start and end at
2009 Jul 21
2
Machinist - having problems stubbing an after_create filter
Hi all
I''m moving to using Machinist in my rspec tests and am having a problem
with an after_create callback method that i need to stub out. It seems
like calling ClassName.make will trigger this callback before i''ve had
the chance to stub it.
Can i stub it in my blueprint for that class? Or, can i stub the method
for all instances of the class before i call ClassName.make?
2006 Dec 04
10
Avoiding SQL Injection in :order?
This thread references:
http://www.ruby-forum.com/topic/90258#new
http://www.ruby-forum.com/topic/82349#143790
ActiveRecord''s find() method has built in ways to avoid SQL injection by
using the format
> :conditions => [ "user_name = ?", user_name]
Is there any such system for escaping injection in :order? It seems to
only take a string and feed it to the SQL
2010 Mar 11
3
Define column names to a series of data.frames
Greets to the list!
I am aware that this topic has been discussed several times. And I've
read quite some related posts [1]. Yet, can't seem to give a solution to
my problem.
I have 6 data frames consisting of 6 rows x 7 columns put together from
other data.frames.
Something like:
a b c d e f g
v1 # # # # # # #
v2 # # # # # # #
v3 # # # # # # #
v4 # # # # # # #
v5 # # # # # # #
v6
2007 Mar 19
1
need help
Hi,
This is praveen,
I'm trying to port a .net applictaion based on windows into mono.My
application is usinf Win32 API to provide more functionality to .net
controls. How WINE is helpful to run the .net application in mono with
win32 calls.
Thanks,
Praveen.
2005 Aug 13
1
Including Fortran subrutines in a package
Hello!
I am creating a packege and I would like to inclued some Fortrun subrutines.
I have two questions.
1. Can I use "free form fortan" - compiles well usinf g77 -ffree-form.
2. Is it enough to place the ".for" files in scr folder?
Thank you in advance for any help!
Ales Ziberna
P.S.: I am runing R 2.1.1 on Win XP, SP2. I installed rtools, mingw, perl as
suggested in the
2009 Feb 25
1
Problem with set_table_name
Dear friends,
I ran the following in my console.Assume I already have the
postgresql connection .
>> class D < ActiveRecord::Base
>> end
=> nil
>> D.set_table_name "users"
=> nil
>> D.column_names
=> ["id", "name", "fname", "lname", "password", "addr1", "addr2",
2008 Apr 24
3
Dynamically Naming a Variable
Hello,
I would like to dynamically name a variable... for example, in my
program, I iterate over a SQL query that gives me ''displayname'',
''phone_office'', and ''phone_mobile'' (in the actual query there are many
more columns). For each row in the results, I want to create an array
with [0]=''phone_office'' and
2010 Jan 29
1
Plotmath: suprscript on scalable delimiter?
ComRades,
How do you put a superscript on a scalable delimiter?
I want to put 'b' as the power of the expression in the following plot:
t <- 1:25
K <- 0.2
y <- ((1-exp(-K*t))/(1-exp(-K*t)*exp(K)))^3
plot(t,y,"l",main="K=0.2, b=3")
text(15,5,expression(bgroup("(",frac(1-e^-Kt,1-e^-Kt*e^K),")")))
Plotmath examples in demo(plotmath) do not
2011 Mar 31
1
Simple lattice question
DeaR ComRades,
require(lattice)
data <- data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)),
x=rpois(60,10),
y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5),
z=rep(1:4,15))
xyplot(x~y|SP,data=data,groups=z,layout=c(2,3),pch=1:4,lty=1:4,col='black',type='b')
How do I put a legend