Displaying 20 results from an estimated 90 matches similar to: "More elegant solution for "missing" has-many through ids?"
2010 Mar 23
0
Frozen hash problem
I''d like to delete some records before saving them. I ran this
experiment:
before_save :prune_lab_datas
def prune_lab_datas
lab_datas.each do |lab_data|
lab_data.destroy
end
raise lab_datas.to_yaml
end
But nothing seems to be deleted in the hash:
---
- &id001 !ruby/object:LabData
attributes:
created_at: 2010-03-21 22:16:06
unit_id: "3"
2009 Sep 24
8
Drop down list ?
Hi Gurus, I''m trying to tackle a drop down list. I have category and
item dbs, and they''re wired up with category has_many :items and item
belongs_to :category, and an item has a category_id. I have this code
in my new/edit.html.erb for item:
<%= f.collection_select :category_id,
Category.find_main, :id, :header, {}, :multiple => false %>
And a pretty drop down list
2010 Apr 01
6
Rails model design visualization
I''m a fairly visual person, and I have a piece of paper with many
boxes and arrows with labels like "has many" and "belongs to" for my
database models. It''s messy, but it works.
What I keep looking for--weeks, actually, I''m certain it''s out there,
but I haven''t hit on the right set of Google query terms :)--is
something that will
2002 Mar 12
3
failsafe against "stupid" / careless users
I'm admin on a samba PDC with 150 users, and as normal users they are quit
"stupid". This means that they ofte deletes something that shouldnt have
been deleted. And I find it anoying to restore their files from tapebackup.
So would it be possible to get samba to "move" files instead of deleting
them? This way I could allocate a disk to store deleted files for a periode
of
2010 Mar 24
6
dispatch.cgi, dispatch.fcgi, dispatch.rb not present in Public folder
I''m doing a series of ruby on rails tutorials and it got to a part
where i need to edit the following files that should be automatically
inside the public folder: dispatch.cgi,dispatch.fcgi,dispatch.rb but I
have none of these inside my public folder. Is there a reason for
this? And how can i change it so they are back
The only files in my public folder at present are
404.html 500.html
2001 Aug 16
1
Deadlock occurring while opening documents in Notes R5
Version is cvs checkout today at approx 0900 CET.
Running on a debian/unstable box with dist-upgrade as of 0830 CET
today, and with no windows installed.
Problem can easily be reproduced, and deadloc happens everytime
I do this. Open database, everything is fine, open document..
wait a few seconds and wine hangs.
output from wine:
-- err:win32:_EnterSysLevel (0x4075062c, level 2): Holding
2010 Mar 23
7
redirection in format.json ...
I have presently a render :json which modify the current page
if @request.save
format.html { redirect_to(@request) }
format.json { render :json => { :result => ''success'', :request
=> request_path(@request) } }
....
but I would like rather to redirect to an index page
I wrote this but it doesn''t redirect ...
format.json {
2006 Jun 13
4
Ruby app to rails?
Hi.
Im am considering porting an c++ application to Ruby, and me company
would also like to have an web-version of this particular application.
If say there is an XML validator in the app. Then can Ruby and RoR share
this in an easy way, so i wouldnt have to maintain 2 branches of the
same XML validator.
Best Regards.
Lasse Thomsen
--
Posted via http://www.ruby-forum.com/.
2001 May 02
3
Weird graphical glitches while running notes.
My system is a debian/unstable box. I'm running daily cvs snapshots of
wine and Lotus Notes R5.07.
The problem is that it seems like wine isn't getting the redraw messages
from the application or wine isn't sending the redraw messages to the
application. So I get large areas of the program blank/black/see through
to old gfx. It especially occurs with frames/framsets in notes.
For
2010 Mar 24
4
grouping and acts_as_tree
hi,
im using acts_as_tree and im not sure on how to group find-result.
x = find.almost_all
<p>
<% for y in @x.ancestors.reverse %>
<%= link_to h(y.title), page %> >
<% end %>
</p>
gives me a nice "breadcrum". but how is it possible to group the list lets
say by the 1level or second level?
thx
--
You received this message because you are
2010 Mar 26
6
Rake argument error
Hi,
I''m having a problem loading a sample data with simple rake command.
rake db:fixtures:load
When I run the above command,I get the following error
$rake db:fixtures:load
(in /home/raghu/www/photos)
rake aborted!
a YAML error occurred parsing
/home/raghu/www/photos/test/fixtures/photos.yml. Please note that YAML
must be consistently indented using spaces. Tabs are not allowed. Please
2003 Sep 02
2
dovecot, vpopmail and djb's tcpserver
Hello!
I've tried to set up dovecot in conjuction with vpopmail, and running it
under djb's tcpserver instead of (x)inetd.
Btw - there was no reference to setting dovecot up using (x)inetd either in
the manuals/faqs i read, though I didn't search all that hard. Anyway, back
to my Q:
vpopmail uses vchkpw as an authentication mechanism, and with tcpserver I
can do relaycontrol (based
2009 Oct 22
3
PDF too large, PNG bad quality
I wish to save a scatter plot comprising approx. 2 million points
in order to include it in a LaTeX document.
Using 'pdf(...)' produces a file of size about 20 MB, which is
useless.
Using 'cairo_pdf(...)' produces a smaller file, around 3 MB. This
is still too large. Not only that the document will be too large,
but also PDF viewers choke on this. Moreover, Cairo has problems
2009 May 08
4
howto find x value where x=max(x)
Hi,
fp is a data frame like this
,----[ fp ]
| Frequenz AmpNorm
| 1 3322 0.0379490639
| 2 3061 0.0476033058
| 3 2833 0.0592954124
| 4 2242 0.1275510204
`----
i want to find the "Frequenz" where "AmpNorm" is max.
I use this line as workaround:
PeakFreqHz = subset(fp, AmpNorm == max(AmpNorm))$Frequenz[1]
Is there something nicer?
And is there an
2006 May 30
11
Display XML file, with some formatting.
Hi.
Im quite new to this Rails thing, but it seems like a good product so
why not try it out whit a little prototype i need to build.
What i want is to load any given XML file, and display it with some
formatting.
I have some XSD shemes to validate the XML files against, but its not
vital rigth now.
But how should i approach this task?
At first it would proberly be a good idea to load the
2017 Dec 14
2
delta and sd parameters for power.t.test
What is the rationale behind having both the delta and sd parameters for
the power.t.test function? For the relevant noncentrality parameter, we
only need the ratio delta/sd. If my effect size is given as Cohen's d,
then I only got that ratio and not sd.
As far as I see, in such a case, I can specify delta=d and leave sd at
its default value 1. Is this correct or am I missing something?
2010 Mar 24
3
flash error & fade away
this is my current code:
#notice {
border: solid 1px #99cc99;
background-color: #e2f9e3;
color: #006600;
padding: 5px;
margin-bottom: 5px;
}
#notice.error {
border-color: #e2f9e3;
background-color: #eeaaaa;
color: #cc0000;
}
<% flash.each do |key, msg| %>
<%= content_tag :div, flash[:error] || flash[:notice], :id => ''notice'',
:class =>
2010 Apr 01
2
paper clip plugin error
coming this error in my paper clilp plugin m getting this error
* Photo C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/
hrithik_roshan1,3756,1.jpg is not recognized by the ''identify''
command.
* Photo C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/
hrithik_roshan1,3756,1.jpg is not recognized by the ''identify''
command.
* Photo C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/
2001 Sep 18
3
Problem with transfering large files.
Hi,
I have some files size 400MB+ that my rsync ends on, error message is :
"Write failed: Broken pipe".
Without this "big files" everything works smoothe.
I searched to find anything about this problem but so far without any luck.
Source machine : Solaris 8, rsync-2.4.6
Destination machine : FreeBSD 4.1.1, rsync 2.4.6
Command run(from source machine):
rsync
2002 Mar 04
2
PDC, NIS and password sync.
Hi.
I have for a while been trying to get my samba 2.2.1a PDC to be a NIS master
and still maintain the password sync feature, without any luck.
Now I made something that seems to work - but I would like to get your input
to see if what I do is ok or it is something I should'nt do.
1: Samba uses passwd to sync the password (not yppasswd)
2: cron runs make in /var/yp every 15 minutes to