similar to: Checkboxes - Saving a Checked record to another table

Displaying 14 results from an estimated 14 matches similar to: "Checkboxes - Saving a Checked record to another table"

2008 Aug 01
2
image_path without timestamp
Every time I use an asset tag helper, there is a parameter appended to the end of my file name. e.g. <input src="/images/search.gif?1213816620" type="image" /> From what I am reading, this appears to be a timestamp for caching purposes. It works in most cases, but I want to use image_path to embed a flash file. .swf file in public/images/flash e.g.
2008 Jun 11
1
Resourse route in namespace with prefix error
Ok so I have this route map.namespace :trades do |trades| trades.resources :buys, :path_prefix => ''/trades/:contract_id'' end I want the contract_id variable to filter a list of buys then I try to open this route http://localhost:3000/trades/1/buys I get a strange error: ActionController::RoutingError in Trades/buys#index Showing trades/buys/index.html.erb where line
2005 May 20
1
Possible PAWS security vulnerability
Hello security gurus, yesterday, I mistakenly posted a question on the questions list about this article : http://www.securityfocus.com/bid/13676/info/ which talks about a form of DOS vulnerability. I was curious as to the possibility of FreeBSD 5.x being affected, and if anyone was working on this or not. Ted Mittelstaedt posted this possible patch based upon the OpenBSD patch : in
2007 Sep 06
4
HABTM association with own class?
If I have a class, Asset, which has and belongs to many associated Asset objects, how do I do this? has_and_belongs_to_many :associated_assets, :class => "Asset", :foreign_key => ?????, :association_foreign_key => ????? Right now, my table has a :first_asset_id and a :second_asset_id, but I don''t see how the objects themselves are supposed to distinguish one from the
2007 Jun 26
4
Can I stub a method on a belongs_to association:
describe Asset, " when destroyed" do fixtures :assets, :videos, :sites, :publish_settings before(:each) do @asset = assets(:test_asset) @mock_hook = mock("hook") @asset.video.stub!(:hook).and_return @mock_hook # error occurs here end it "should call the delete hook" do @mock_hook.should_receive(:update).with("test_video",
2013 Feb 24
1
Use of the newdata parameter in the predict.coxph function
Hello, I've executed the following predict.coxph function to enable prediction for new variable values (error is included). *predict(cox_out,newdata=data.frame(Meter3.Value=100.001, Meter4.Value=200.001,Meter5.Value=300.001,Meter10.Value= 400.001,type="expected")) Error in model.frame.default(data = data.frame(Meter3.Value = 100.001, : variable lengths differ (found for
2011 Jun 04
0
Rails 3.1 : Complex database query with Arel 2
Hi, I''ve search for documentations on queries with Arel 2 but there is pretty nothing and all I''ve found is for Arel 1 so I''ve run into NoMethodError: undefined method `[]'' for #<Arel::SelectManager:0x00000003f1b820> errors with join syntax. My query is barely simple but involve nesting queries. I have 4 tables. Assets, Deposits, Orders and OrderLines
2009 Mar 25
0
Optimise this association?
hey all In my schema, Lesson is many to many with Asset (through join table ''elements''), which are also many to many with Resource (through join table ''items''). This is all done with totally standard "has_many :through" - Lesson has_many :elements, :dependent => :destroy, :order => :position has_many :assets, :through => :elements,
2007 Aug 30
3
has/belongs to many sql error
I have a model Asset which has_and_belongs_to_many :tags. Tag has only one field, name. There is a table assets_tags which only has an asset_id and a tag_id. I can add a tag to one asset. If I try to add the same tag to another asset though (asset.tags << tag) I get this error: Mysql::Error: #23000Duplicate entry ''4'' for key 1: INSERT INTO assets_tags (`tag_id`, `id`,
2008 Mar 13
3
Refreshing a page gives a "stack level too deep" error.
I''m converting our app into restful rails. A couple of my classes (Resource and Asset) have a has_many relationship with each other - here''s the routes: map.resources :assets, :has_many=>[:resources] map.resources :resources, :has_many=>[:assets] I''m getting something weird in my view pages. When i go to /resources/4/assets it works. I go to the page
2006 Apr 11
2
FreeBSD 6.0 panics - sbdrop
Hi, I've encountered a strange problem while using FreeBSD 6.0 for our local mirror (mirror.math.uni-bielefeld.de) and thus is providing access via ftp, http, rsync and cvsup (all local and remote). The system crashes periodically with a kernel panic (panic: sbdrop). The uptimes between two crashes are going from a few hours to a few weeks. The system is a i386, Intel Pentium 4 based with
2005 Dec 20
0
validates_uniqueness_of on has_and_belongs_to_many
I am trying to create a model that allows only unique assets to be added to a category. However, they could be added again to a different category. Finally, an asset can be shared across many categories. So my question is how do you check the uniqueness across a join table? This does not compile.... has_and_belongs_to_many :categories, :foreign_key => ''asset_id''
2007 Nov 08
0
Dynamic relation with eager loading
A model has 2 columns in its table asset_type_id asset_id the asset_type_id links directly to the table asset_types via a belongs_to asset_types contains a single column ''name'' method_missing in the model says when you call a method matching /^asset.*/ call the corresponding method substituting ''asset'' for the contents of asset_type.name (ie. the name in
2010 Apr 05
0
Risk Assessment Application
I am going to be developing a Risk Assessment system for a secure environment whose database will double as an asset management system. Or at least the Risk Assessment stuff will be an outcropping of the asset management system. Has anyone had any experience with this or a similar project? This is my first attempt at a Rails project after spending a few weeks reading books and getting a general