Displaying 20 results from an estimated 1300 matches similar to: "Object lost in memory/trashed?"
2006 Aug 04
4
DRY DRY DRY
Hello everyone!
Ive been on rails for the last month or so and really enjoyed this
framework.
However its very hard to find documentation on how to do things right!
For example every beginner after a while realizes that having similar
CRUD actions in every controller and views for them is not DRY at all!
Few days ago I found http://dereksivers.com/rails-shared-controller.html
I quite like his
2008 Jan 12
1
Collection_Select not showing Selected option
Hi, I''m having some problem with getting collection_select to return
the current value when editing a record. According to everything I''ve
seen, there was an issue but it''s been fixed, but I can''t figure out
why it isn''t returning the current value as a selected option. I''ve
checked the table structures, and both the call_driver.product_line_id
2012 Apr 25
2
Rails 3.1 - Scaffolding Files
Where can I find more information about the new syntax on these:
<%- model_class = @product.class -%>
<h1><%=t ''.title'', :default => t(''helpers.titles.new'', :model =>
model_class.model_name.human,
:default => "New
#{model_class.model_name.human}") %></h1>
<%= render :partial =>
2009 Aug 28
0
Nil object nightmare
I''m having a real problem with nil objects in a view I''m playing with.
if I type ...
<%= debug lesson.lesson_register.attendees %>
I get the following displayed in the browser ....
- !ruby/object:Attendee
attributes:
enrollee_id: "25"
created_at: 2009-08-27 15:10:41
updated_at: 2009-08-27 15:10:41
id: "1"
attended: f
2006 Jun 08
3
Macros and stuff
I was looking at my controller code and the edit/create/update/new for
each are practically identical. So first I DRY''d the four methods in
each controller to just one and then I decided to write a single macro
for all my controllers.
This is the macro:
def self.edit_action_for(model, options = {})
model_class = Object.const_get(model)
define_method(:edit) do
2006 Jan 23
2
del.icio.us-like output
I''m trying to build a page similar to a delicious page that is a listing of
your bookmarks in this format:
1. Querying serialized data in
ActiveRecord<http://www.karmiccoding.com/articles/2005/11/29/querying-serialized-data-in-activerecord>
Hack
to search serialized fields
to rails <http://del.icio.us/djsodom/rails> ... and 4 other
2004 Nov 12
1
Firefox keyword searches for R & S-Plus
If you've 'rediscovered the web' with Firefox (http://getfirefox.com), you
might find this tip handy. Suppose you want to search the (local) R
documentation for information about the lme function. Wouldn't it be nice
to just type into the browser address bar:
r lme
and have the search performed? Here's how (on Windows):
Click on this link:
2006 Jun 14
0
testing table associations
First, thanks to everyone who replied to my pluralization question
from before! Today I''m confused by associations. I''ve set up a bunch
of associations in my models to describe these relationships:
- each user can have many bookmarks and tags
- each bookmark can have many users and tags
- each tag can have many bookmarks and users
(Part of what is confusing is that I can
2005 Sep 01
0
Multi-Page Websites VS AJAX
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I found this to be quite interesting not sure if there are any plans for
implementing it.
The problem
In a regular Multi Page Interface (MPI) website, each page has a unique URL.
These URLs can be used to bookmark your location, and the browsing history
is just a list of those URLs in the order you visit them. An AJAX
application however has a
2006 Jan 15
1
Attributes of a relationship
Hi all,
I have two types of models which I''m not sure how to model (or if it''s even
feasible) with ActiveRecord. Let me know if you''ve got any good ideas.
1) For those of you who are familliar with del.icio.us, you probably know
that you can bookmark a site, and add your own tags to it. Each person has
their own tags for a site, even though multiple people can
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 Feb 07
0
wice grid
I am trying to use wice grid plugin and I have run into problem. The
problem is when I have nested paths as follows:
Hardware :has_many installed_softwares
Software :has_many installed_softwares
installed_softwares belongs_to both
when I view individual hardware, I have a link "Installed Software" ->
hardware_installed_softwares
when I use wicegrid to view installed software and
2005 Dec 17
3
Question on Db Table design
Hi
Suppose one has a db to track bookmarks for multiple users.
Let''s assume that there are ten''s of thousands of users, and that
an average user may have 100 bookmarks. (Assume here that no
two bookmarks are the same.)
Is it a common practice to have a bookmark table for ALL users, thereby
producing a table that has on order one million rows.
Or, is it better to somehow group
2001 May 15
1
How to display bookmarks on Lotus Notes 5 - Here is the solution
If you use Notes 5 with wine, you probably have the problem, that the
bookmarks frame doesn't open when you click on Favourites or other folders
on the left side.
Solution:
Create a Memo in Notes
Go to the Body field and select Create/Hotspot/Button
In the lower half, select Script and paste in this code
Sub Click(Source As Button)
Dim db As New
2007 Mar 29
21
a better "should have valid associations"
This is pretty much the same as last time around, if you recall.
Thanks to Wilson for converting to the new form. I''ve added a few
lines. Basically, it iterates over your model associations and does
two things.
- First, just try to call the association. Usually fixes speeling
erors or other such silliness.
- Second, try to find a record with an :include on the association.
This
2005 Sep 12
1
Multi-Channel/Stream support?
Hi all,
I'd like to know how well Speex handles multiple input streams. More
specifically, if i have 4 streams that are playing at "the same time", how
well does the CODEC handle switching from one stream to the next to process
the audio.
The reason i ask is this....My project up until now uses the MELP CODEC
which didn't specifically have the ability to handle multiple
2006 Mar 21
5
Object#id being deprecated - Rails 1.1
Hi
Think this is probably straightforward, but I don''t know enough about
rails to work it out, so was wondering if anyone can help
I keep on running into this error when I''m deploying my app:
"FastCGI: server ".../public_html/public/dispatch.fcgi" stderr:
../config/../app/views/items/_side_share.rhtml:8: warning: Object#id
will be deprecated; use
1997 Jul 25
0
What page was it ?
If you ever picked up a book and forgot which page or
paragraph you stopped at - you need a ParaMark BookMark.
Used by students, avid readers, and teachers everywhere,
the nationally acclaimed ParaMark BookMark is the worlds
first "smart" book mark. Visit our website today to learn
about "smart" ParaMark BookMarks.
Find "Smart" BookMarks:
2008 Feb 20
0
Creation of Bookmark Button
Hi Everyone,
I want to create a button in my app which can be placed on browser
bookmarks toolbar.
And for any website when i click on that bookmark, it will open a
layered window (like popup) which
will have page title and domain name of that page And also it will
have some input fields. It will be
a form from my application. And when i will submit that window will
close down and update
2003 Dec 18
1
sharing bookmarks with rsync
I would like to have my computer at home and my
computer at work to share the same bookmarks. My idea
was to have each of the computers sync with a server's
bookmark file. If the client has a newer file than the
server it would upload it, if the client has an older
file it would download it. I already have the
authentication keys set up and want to do it over ssh.
Would this be one way to