Displaying 20 results from an estimated 5000 matches similar to: "Populate table from another table"
2007 Jan 31
6
Using hash.keys - why doesn't it display in order created
I am using .keys on a hash to create an array that is than displayed
in a view with .each - why does it not display the keys in the order
added to the hash?
I would like to controll how the array is displayed - I want the
checkboxes to display like I added them to the hash, but it doesn''t -
I can''t figure out how it is displayed, when I change the order of the
hash it
2007 Feb 09
7
Upload image without rmagic
I need a way to upload an image and display it without using any of
the plugins that use rmagic. I have used the plugins (file_column,
fleximage) which both use rmagic and gave me problems (never got
fleximage to work)
Thanks in advance - K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2010 Oct 04
3
OpenOffice or LibreOffice?
Given that the Document Foundation has now split away from Oracle to
continue the development of an independent office suite, do we have
any idea which was CentOS and Red Hat are planning to go in this area
- OpenOffice or LibreOffice?
I know that LibreOffice is not production ready yet - they only have
their first beta available, but it's just a matter of (likely a short)
time before the
2013 Mar 07
3
Pattern for Associating Module versions with Nodes
Hello All,
I''m wondering what is the canonical way of associating "specific"
versions of a module to a node? Is there a way of doing this in puppet?
Let me explain a "Use Case" of what I''m trying to accomplish:
Say we have created a puppet model called apache to manage and configure
apache webserver.
We have the apache module under version control and
2005 Dec 21
8
text_area
Hi I''d like to know how to add default text text area using the function
text_area. I ''ve tried using value = "....." to do this but with no
luck.
Could some one please answer my simple question?
Thanks.
Dan.
--
Posted via http://www.ruby-forum.com/.
2012 Jul 23
6
librarian-puppet vs git superproject?
Can anyone comment on their experiences with librarian-puppet or using git
superproject with per puppet module repositories? We are in the midst of
determining which route is optimal for our environment. It seems like using
git superprojects would mean one less new tool for everyone to learn. What
then would be the advantages of librarian-puppet?
Thanks,
Ryan Bowlby
--
You received this
2009 May 25
4
after_create and has_one association bug?
Hello,
I''ve come across an issue that I''m sure is a bug when using after_create
with a has_one association, but I''m not 100% certain if I''m missing
something.
This is pretty much exactly the code I''m using. Two simple classes
(Account and Contact) and I create the contact after I create an account
(via after_create). I''m not passing in a
2012 Oct 31
1
librarian-puppet
Unless I install puppet vis gems, I get the following error when attempting
to use librarian-puppet.
librarian-puppet
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error'':
Could not find RubyGem puppet (>= 0) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate''
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:249:in
2006 Jul 18
7
Observer not working
Help please.
I''m trying to observe a User class, but I can''t get this to work, the
after_create method never gets called... (the breakpoint never gets
called)
app/models/user_observer.rb:
class UserObserver < ActiveRecord::Observer
def after_create(user)
breakpoint
setting =
2006 Mar 15
4
help with DRY violation
I''m trying to be a good rails developer and fix DRY violations as i find
them. However, i''m trying to fix this one, i cant seem to get it to work.
I have two tables A and B that have a one-to-one relationship. Table B
belongs_to Table A. Table A has_one Table B. I''m creating instances of
Table A in different places, depending on the controller. However, for each
2009 Mar 29
2
after_create and after_save
Hi,
AFAIK after_create is called after_save if the entry does not exist in
the DB.
Is there a way to tell if a specific model is new or not in
after_save?
I have to do something like:
def after_save
add_to_history ''save''
end
def after_create
add_to_history ''create''
end
However after_save is called when creating too.
--
cheers,
M.
2007 Feb 05
1
long jumping out of code in specs
I wrote this abomination just now, and wonder if anyone else has had
experience with the pattern behind it. In short, I''m specing an
after_create hook on an ActiveRecord model, that calls a bunch of
private methods. Instead of stubbing all those private methods (which
is verboten anyway, as well as impossible because creating the object
which owns those methods is what I''m
2008 Sep 23
3
calling save in after_create hook
Scenario:
I''m creating an image file upload service for my web site.
As well as saving the actual file I also need to create a database
record for the file.
I would like to name the file after the record id, but I also need to
save some attributes of the image (width/height/mime_type etc) which I
can''t discover until after the file is created.
The Problem:
1) The id is not
2010 Feb 10
16
nil object - can anyone help?
Hi there,
I''ve been looking for a while now and can''t seem to find where I''m
going wrong..
I''m following a railscast tutorial to send invites out to people.
there''s n invitation.rb page:
class Invitation < ActiveRecord::Base
#attr_accessible :sender_id, :recipient_email, :token, :sent_at
belongs_to :sender, :class_name =>
2006 Aug 17
4
Automatically creating associated records with after_create
Hi all.
I am actually using ActiveRecord outside of Rails but I don''t see that
it matters for this question.
I want to automatically create a registration entry when I add a new
user to my application. This works fine, but it''s not automatic:
class User < ActiveRecord :: Base
has_many :registrations
end
class Test
user = User.new
user.registrations.create
end
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 Apr 16
5
render :collection and default value
Hi all,
I am having a lot of trouble to get the default value of text fields
when they are generated by a partial from a collection.
I have been on this for a whole week and I didnt find a single exemple
on the internet of someone using a partial that generate text field with
a default value.
I cant believe that I am the only one having this problem. Anyone has an
exemple they can show me?
2007 Dec 13
16
"Tricks" for testing after_create callback???
I''ve got a model Message, which needs to send an email using action
mailer after it''s first saved in the database.
I want to pass the model to the mailer which then uses methods on the
message model to render the email.
So the natural way to do this is in an after_create callback on the
Message model.
But I can''t see an easy way to test this. Here''s my spec
2006 Oct 27
8
Error after moving to production server
so i have an after_create method on my track model that kicks off a
background process that converts an mp3 to a swf.
this is working fine locally on my machine, but upon moving it to my
production server, i am getting the following error. I''ve only been
using backgroundRB for like 48 hours, so i''m not really sure what
this means or where to go. any ideas?
2006 Aug 14
2
after_create is not being called
Hi all
I have the following model:
class PhotoGallery < ActiveRecord::Base
attr_accessible :title, :description, :file_path, :title_photo_id
has_many :photos, :dependent => :destroy
belongs_to :title_photo,
:class_name => ''Photo'',
:foreign_key => ''title_photo_id''
validates_presence_of :title, :description, :file_path