Displaying 20 results from an estimated 400 matches similar to: "Okay, what gives? find_by_id is failing."
2006 Apr 01
12
Repost: Why is rails generating bad SQL?
It looks like I am missing something obvious. ActiveRecord is
generating _really_ bad SQL for this configuration, and I can''t quite
figure it out.
I''ve instrumented ActiveRecord enough to localize the problem somewhat,
and generally by this time I would have a good idea of what I was
missing because it''s all in the source.
It appears that something in
2006 Apr 20
1
Rails is losing key information
I am using ruby 1.8.4 with rails 1.0 under fedora core 3 on a WIntel
platform.
Rails appears to be losing key information under some circumstances.
Specifically, in the Questions class that follows, the presentation_id
property is apparently being lost.
The STDOUT dump from the create method indicates that the
presentation_id should be 42, but the dump from the database shows that
it is 43,
2006 Mar 12
2
Ruby syntax question, I think ...
I am successfully navigating between controllers. However, I am unable
to construct a new child (question) record.
What does "undefined method `stringify_keys!'' really mean"?
I think I am missing a subtlety of Ruby syntax here, since the
question_controller is actually trying to call the Question constructor.
Can someone point out what I am missing please?
Thanks in
2006 Jul 14
3
Rails newbie: How does the submit_tag work?
I would appreciate any and all input. The Agile book is not useful in
this context. :o(
As near as I can tell, it doesn''t work at all.
I would expect that clicking on the [Next Question] button in the
browser would fire the next_question method in the current controller.
Instead, it (apparently) does nothing.
The tag in question
<%= submit_tag ''Next
2006 Jun 03
12
How to get dynamically created inputs from html form back to rails app
Thank you in advance.
Although I have many years of experience in general, including cross-
platform processing, I am not an HTML/Javascript programmer. As a
result, I do not have certain specific baseline skills and/or knowledge
that are presumed in the Rails and Ajax documentation.
I am experienced with DOM manipulations, so the bare mechanics of
manipulating the browser GUI via Javascript
2006 Mar 15
8
Tags to ruby interface: What I am missing? (repost)
I offer my apologies in advance for the repost. On a list as busy as
this, it is sometimes easy to get missed in the shuffle.
I am trying to create, display and edit a referenced object''s text field
on the same view as my root object.
For example:
-------------------------
Quiz: <<quiz.name>>
Preamble: <<quiz.preamble_presentation.text>>
Postamble:
2006 Jul 30
1
Bug? find_by_id(nil) returns object just created
Tried to submit a ticket in Trac, but it reported an error...
Doing a Model.find_by_id(nil) after creating an object of type Model returns
that object -- and the next time, returns nil. It should always return nil.
For example,
Step 1. Create an object:
>> Foo.create(:name => "bar")
=> #<Foo:0x2aaaac3ade20 @new_record=false,
2006 Jul 13
2
find_by_id(nil) does not always return nil
I have a model named User. When running this application from the
console I can call User.find_by_id(nil) and it returns nil. When running
this application during testing or through WEBrick or Mongrel calling
User.find_by_id(nil) returns the newest record in the database. But it
only does this the first time you call it with nil. The second time you
call User.find_by_id(nil) it returns nil.
2009 Dec 28
2
Override .find, .find_by_id, etc...
I read these:
http://www.ruby-forum.com/topic/185297#new
http://www.freezzo.com/2008/05/14/override-default-find-conditions-for-model/
it works, it override the .find perfectly, however it does not cover
.find_by_id or other .find_by_XXX
Is there anyway to override all the find function of a modal? I want to
set the default "select" for User modal, only return name and id, but
not the
2006 Jun 27
3
find_by_id vs. find in postback action
I''m playing around with the Postback action recipe listed in the recipes
book.
Here is the default code given:
def edit
@recipe = Recipe.find_by_id(params[:id]) || Recipe.new
if request.post?
@recipe.attributes = params[:recipe]
redirect_to :main_url and return if @recipe.save
end
end
Here is what my code sort of ended up looking like, altho i''ve ripped it
apart
2008 May 16
3
has_one and find_by_id issue
I have two models:
testamonial
photo (has_attachement)
testamonial has_one photo
The issue is when do this:
@testamonial = Testamonial.find_all_by_id(id)
I get "undefined method `photo'' for" in my browser?? BUT here is the
big kicker....
If I do @testamonial = Testamonial.find(:first)
everything works fine and the image is show!.. (find :all works too
when I loop
2006 Mar 28
1
Rails generates query with reserved word for field name
For some reason, rails is generating this SQL:
SELECT FIRST 1 * FROM questions WHERE (parent_id IS NULL) ORDER BY
position DESC
1. There is no column named position referenced in my code.
2. POSITION is a reserved word in SQL92. It is the name of a string
function that returns the offset of one string within another. I
believe that this is a bug in Rails. Either position should be
2005 Sep 04
0
help on 2 X-Lite: call failed: 404 not found
Dear All,
I installed an Asterisk on a linux PC, and X-Lite on two Windows
PCs, all in a LAN.
But, when I make phone call from one X-Lite to another, I always get
Call Failed: 404 not found.
Here is my sip.conf:
[Phone1]
type=friend
host=dynamic
;defaultip=192.168.1.103
2010 Jun 01
1
[PATCH] RHEV: OVF must have the same name as the OS UUID
ovf:Envelope/Content/Section[xsi:type='ovf:OperatingSystemSection_Type']/@ovf:id
is actually the canonical UUID of the guest, and must correspond to the
filename. If it doesn't, the VM cannot be deleted from the export domain.
Fixes RHBZ#583536
---
lib/Sys/VirtV2V/Target/RHEV.pm | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git
2007 Jun 01
0
Okay, new question - dealing w/ logging in restrictions (controller?)
Hey all, so if you read my previous thing about nested routes - I''m
just not going to do with them anymore.
Anyway, so my controller has a before_filter on the edit action; which
checks to see if the current post''s user, is the same as the currently
logged in user, if true then they can edit, otherwise not.
def check_user
if current_user.login != @post.user.login
2003 Nov 26
0
Okay one last question...
(for now, anyway :)
I have a panel, and I want to be able to adjust the size
programatically. I don''t have any sub windows, all I am doing
is drawing a bitmap into the DC.
I''ve tried set_size, but nothing seems to happen...
Do I need to go to all the bother of creating a sizer, blah, blah, blah,
or is there some kind of event I need to trigger to force a resize,
or...?
2003 Nov 26
0
Okay one last question...(again)
[Arrg this might show up twice, I sent from the wrong account]
(for now, anyway :)
I have a panel, and I want to be able to adjust the size
programatically. I don''t have any sub windows, all I am doing
is drawing a bitmap into the DC.
I''ve tried set_size, but nothing seems to happen...
Do I need to go to all the bother of creating a sizer, blah, blah, blah,
or is there some
2004 Jul 20
0
attaching printer w/user level sec; XP okay, 2k won't work
So I've spent a couple of hours on this and I think I've found the problem.
I have cups and samba running on the print/file server.
I have a 2k and and XP system as clients.
All are in the same workgroup.
I started with share-level security, and everything worked okay.
Then I decided to tighten it down a bit, and moved to user-level security.
XP could connect to both the printers and
2004 Oct 13
0
Okay I'm stumped.
I have a very weird issue with isolinux.
I create disks with a bootsector, kernel etc.
The CD's boot fine on most machines, but on a significant number the bios just
completely ignores them. Yet these same bios's boot a number of linux CD's
all using isolinux.
Moreover a lot of time the same bios will fail with a CD, yet boot the same
iso if it's burned onto a DVD.
The only
2001 Nov 06
0
Okay...
Who sent the Stalking Ninja after me.... I haven't been THAT bad today
have I? ;-)
Ed
> Date: Tue, 06 Nov 2001 16:05:00 -0600
> From: NINJA-DISPATCH at bluesforbuddha.com
> To: Ed Phillips <ed at UDel.Edu>
> Subject: You are being stalked by an enemy ninja!
> ...
Ed Phillips <ed at udel.edu> University of Delaware (302) 831-6082
Systems Programmer III, Network