similar to: Best way to pass ID variable to partials - global var??

Displaying 20 results from an estimated 4000 matches similar to: "Best way to pass ID variable to partials - global var??"

2007 Apr 11
12
redirection doesn''t get detected well?
I''m doing a redirect in one of my controller actions and somehow I can''t spec it, see this pastie: http://pastie.caboo.se/53120. When following the link from a browser I''m being redirected to the right page. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 May 26
4
Using ''validates_inclusion_of'' to validate foreign key
I seem to be missing something trying to use ''validates_inclusion_of'' to validate a foreign key and was hoping some one could piont out my mistake? The problem seems to be that Order.find_all.collect is not returning an array that contains the order_id, if I replace it with a hardcoded array everything works as expected. The model: class OrderItem < ActiveRecord::Base
2006 Jan 12
5
Question about using DISTINCT in ActiveRecord find method.
Hi, Am relatively new to the RoR world. My question is quite simple. I have a query like such: shipmentNumbers = Order.find_by_sql(["select distinct s.id from orders o, line_items li, shipment_lines sl, shipments s where o.number=? and o.id = li.order_id and li.id = sl.line_item_id and sl.shipment_id = s.id", number]) The above query works fine. I wanted to do the same query using
2006 Mar 31
2
Model inheritance is borken in Rails1.1
following is model code in file order_payment.rb class OrderPayment < ActiveRecord::Base belongs_to :order validates_presence_of :amount, :no end class LC < OrderPayment end class LC30 < LC end class LC60 < LC end class LC90 < LC end class LC120 < LC end class TT < OrderPayment end class CAD < OrderPayment end and following is error i''m getting with
2007 Sep 05
8
Hi..Guys new plugin again
Hi.. Guys new plugin again Foreign Key Associations is a plugin that automatically creates associations based on foreign-keys. The associations are created at runtime-ie. as your ActiveRecord models are loaded-so they will always be up-to-date. For example, given a foreign-key from a customer_id column in an orders table to an id column in a customers table, the plugin creates:
2006 Dec 07
2
Problem saving parent and children using belongs_to, class_name, and foreign_key
Hi, I have a real simple association setup here that''s just trying to: - Create a new PayjunctionOrder - Create some LineItem objects and assign them to the PayjunctionOrder - Save everything I''m using Rails Edge. ---- class PayjunctionOrder < ActiveRecord::Base has_many :line_items end ------------------ ---- class LineItem < ActiveRecord::Base belongs_to :order,
2012 Jan 26
1
adding additional information to histogram
Hi, I am a beginner with R, and I think the answer to my question will seem obvious, but after searching and trying without success I've decided to post to the list. I am working with data loaded from a csv filewith these fields: order_id, item_value As an order can have multiple items, an order_id may be present multiple times in the CSV. I managed to compute the total value and the
2006 Jun 20
1
ActiveRecord saving madness?
Hello, First of all, I love RoR. I am studying it, and I am finally "getting there". However, I do have a bit of a problem with ActiveRecord''s saving behaviour. Imagine to have Orders (id, name) {has_one:invoice} and Invoices (id, order_id) {belongs_to :order} . If you type: invoice = Invoice.new(...whatever...) an_order.invoice = invoice if invoice fails to save, you
2013 Feb 18
6
How to clear ActiveRecord query cache on associations with dynamic table
In part of my application I''m using dynamic tables. I''m aware of the single thread conditions. I''ve tackled some caveats yet - will post a blog about it soon - but there''s one I need help with. Consider 2 models that are associated: Order and OrderLine where Order has many order_lines. Now we set the table names for them:
2005 Dec 21
3
Lazy Loading?
I''m having problems with what seems to be lazy loading behavior in Ruby on Rails. I have two objects in a parent-child relationship such as: class Order < ActiveRecord::Base has_many :items, :dependent => true end class Item < ActiveRecord::Base belongs_to :order end I put an instance of the Order object into the session using: session[:order] = Order.new
2006 Jan 06
6
HABTM problem not saving all associations
Hello all, I have an Order object that has and belongs to many Products and has and belongs to many Loan Types. This is so I can select multiples of each in my order entry screen via checkbox groups. I''m having some trouble with saving multiple HABTM associations for a single model object; only the first HABTM association declared in the model will save during the initial @order.save
2006 Feb 24
7
One To Many To Many
Hey all, I''m trying to find a simple way to reference all of the objects that belong to their parent''s parent. In other words: Clients --> Orders --> LineItems How do I get all of a client''s lineitems in one array (i.e., client.all_lineitems)? Thanks! -Neal -- Posted via http://www.ruby-forum.com/.
2006 Feb 16
9
association not inserted automatically.
Hello, I am trying to write a sample application. I have class LineItem< ActiveRecord::Base belongs_to : order end && class Order < ActiveRecord::Base has_one :line_item end Now in the controller i am trying : def add @ord = Order.new(params[:ord]) @ord.line_item = LineItem.new(params[:lineitem]) if @ord.save redirect_to :action => ''list'' else render
2006 Mar 21
11
Stuck on ActiveRecord
Hi, I''m having great fun developing with Rails but I''ve come to a problem that I can''t quite figure out. I have an Order object that "has_many" order_lines. This works perfectly and I can see all the lines. The OrderLine object has an order_id field as well as product_id and amount. Now ideally I would want to do : order.orderline[0].product.name for
2006 Jun 13
2
Query for multiple tables with find question :)
Hello all, I am trying to figure out how to do this with find instead of doing it via find_by_sql For example I am trying to list all my completed orders, however I need to check the progresses table to make sure the "currentlevel" in the progress table equals "endlevel" in the orders table. The sql below works fine, but I am just curious how to do it another way. def
2005 Dec 14
5
inserting multiple rows
I have table which stores multiple entries. Each row has user_id, game_id and a pick_id. On a page the user has to make load of choices. All this gets submitted. the html looks like so: <input type="hidden" name="game_id" value="3"> <input type="hidden" name="user_id" value="19"> <select name="pick[3]"> ....
2013 May 14
5
Why joins queries make result readonly?
Are there any rationalies to make queries obtained by joining scope to be readonly? I read some old posts (pre-rails3) that joins adds additional columns to record so that ActiveRecord doesn''t know how to update that fields, but actually I don''t see that fields. For example I write model class Order < ActiveRecord::Base has_and_belongs_to_many :executors, class_name:
2020 May 29
3
Extended attributes not working on mac
I worked with Netatalk for years and want to switch to Samba now. Currently i use Ubuntu 20.04. and Debian 9 before, i had no issues with netatalk at all. As soon as i try to add a color tag (e.g. yellow) with Mac OS 10.15.5, the tag appears shortly but hides one second later. The file system is ZFS with no special options configured. I tried the Ubuntu package but also the builds from source
2015 Dec 28
2
vfs_fruit: cannot remove any file
In case of OS X 10.9 and later, any file could not be removed. $ rm test.txt rm: test.txt: Resource busy cannot remove: OS X 10.11.2 El Capitan OS X 10.10.5 Yosemite OS X 10.9.5 Mavericks can remove: OS X 10.8.5 Mountain Lion OS X 10.7.5 Lion OS X 10.6.8 Snow Leopard Windows 7 Environment: Fedora rawhide samba-4.3.3-0.fc24 smb.conf: [global] workgroup = LOCALNET server string
2016 Jun 09
6
Samba 4.2 - OS X 10.11 - permissions are being ignored
Hi, when saving a file to this share the permissions (0777) are being ignored under OS X 10.11.5. All files will get these permissions: 0755. I don't know why? Samaba Version 4.2.7-SerNet-RedHat-19.el6 CentOS release 6.7 [global] workgroup = BAVARIA server string = Samba Server %m netbios name = NASBAV1 log file = /var/log/samba/%m_%a_%R.log