similar to: Getting joined collections on a form

Displaying 20 results from an estimated 1000 matches similar to: "Getting joined collections on a form"

2006 Jul 21
0
Selecting customers and addresses in a form (was Getting joined collections on a form)
(Sorry if you have received this twice, I''m having trouble sending mail to the rails list) Greetings, I''m looking for suggestions on how to simplify getting customer addresses on a form: I''m jumping between controller and view several times; alternating between rhtml and rjs, in order to display customers and their addresses on an invoicing form. It''s very
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:
2014 Apr 11
0
Rails 4.1 activerecord_relation conversion to array problem
After I upgraded from rails 3.2 to 4.1 I am getting this error below. I researched that Rails 4.1 requires a conversion of an activerecord_relation to an array using to_a. I did use to_a but looks like rails is doing a select count behind the scenes. Do you know how to fix this? def index order_type = params[:order_type] @oh = OrderHeader.select("orders_header.*, users.username,
2007 Oct 17
9
@session['user'] vs session[:user]
This might seem really simple to some but just wanted to ask: what is the difference between @session[''user''] and session[:user] ? and how would you use each? And another question, I have the following code: def get_customer if @session[''customer''] @c = Customer.find(@session[''customer'']) end end private def
2006 Jan 03
1
options_from_collection_for_select - NIL Object
i am kind of desparated i try with options_from_collection_for_select to get option values, but it says You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.inject but @customers is not empty -> def get_customer @customers=Customer.find_all end i have tested it and also the attributes "id"
2007 Jan 08
1
Realtime Voicemail Table Column Name Question
Hi All, In the realtime voicemail table the column 'customer_id' is used, for my purpose, to specify the customers accountcode. The column name 'accountcode' is used in the iax and sip tables. To keep this consistent throughout the tables, is there any reason I should NOT switch the column name 'customer_id' to 'accountcode' in the voicemail table? Does Asterisk
2009 May 14
3
Mysql query is not working
Please, Can anyone help me to execute this query? SELECT * FROM table WHERE customer_id IN (SELECT IF(1 <> 2,''SELECT customer_id FROM customers'',''SELECT customer_id FROM company'')) Regards... -- Posted via http://www.ruby-forum.com/.
2008 Jun 14
0
does BackgrounDRB not "know" the rails environment it is running within/in parallel with?]
Hi, it probably is a noob question but I''m confused by this error message: active_support/dependencies.rb:478:in `const_missing'': uninitialized constant Invoice::ApplicationController Situation: I have an InvoicesController with a create method that in turn calls upon a MiddleMan.worker(:billing_worker), which in turn finds an Invoice and calls upon @invoice.print_invoice
2007 Sep 21
2
ActionWebServer and SOAPFault
I''m really new to RoR and my first task is to write SOAP web service. The problem is that I don''t understand how to send custom SOAPFault messages in case of the errors. For example, I have FindCustomerById API signature: api_method :find_customer_by_id, :expects => [{:customer_id => :int}], :returns => [Customer] And controller: def
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
2005 Dec 23
0
adding items to a particular invoice on the same page
Hi, I have been building a invoice generator(in ruby on rails) for the past some days and been stuck on the final page .This page will have fields for entering the invoice details and also I have added a AJAX effect so that fields for invoice items get created dynamically . its all design well but the issue comes when I am trying to save the page .That is adding ivoice details to invoices
2006 Jul 31
0
MY worker won''t stop working
> On Jul 30, 2006, at 5:11 PM, Chris H wrote: > >> Hi Ezra, >> >> thanks for the reply. >> >> There''s a ruby process that appears in top when I fire off the do_work >> method. >> It uses around 30-50% cpu and disappears once all processing has >> completed. >> >> When I try to stop processing using delete_worker I was
2005 Dec 24
0
Problem with the association.
I have a problem with the association. I have the model called Invoice whit the associations: belongs_to :company belongs_to :client belongs_to :type_invoice has_many :row_invoices belongs_to :bank belongs_to :payment When i create the invoice i use a session variable, so i can add all the information i wont and I can save all at the end. This is all ok. def new session[:invoice] =
2006 Aug 15
1
serialisation
the case: i have two classes: 1) class Contract < ActiveRecord::Base serialize :addons end 2) class Addon < ActiveRecord::Base end Now i do the following in contract_controller: def create @contract = Contract.new(params[:contract]) @contract.user_id = session[:user_id] @contract.customer_id = params[:customer_id] @contract.pending = 1 @contract.addons = Array.new end def update
2007 Aug 13
0
Invoice system
Hi, I wanna make a invoice system. I''ve set up a invoice model and a invoice_item model (invoice has_many invoice_item and invoice_item belongs_to invoice). Also invoice belongs_to a customer, and a customer has_many invoice. My problem is i don''t know how to create the form for making a new invoice. I''ve made a similar system in php, and here is how the html form was:
2006 Jan 03
4
Would someone like to tell me why this code will not solve my problem? (it''s short)
I am building an invoicing system but cannot use the auto_increment field to determine the invoice number (because they are running 3 different companies off the one system. I need to find the last invoice number from any given company and then add 1 to it to get the next invoice number. BUT, there is a unique case on the very first invoice produced because there is no earlier invoice
2017 Nov 21
1
R-How to unlist data frame multiple structured list column value and new column
Hi, How to unlist list column value and add column into data frame. Data frame ID ContractDe PassengersDe TrainnerDe 1 list(ConID=c("Zx","78yu"),ConRes = c("98","Tut")) list(PassID
2018 Apr 10
3
Invoice numbering for customers
Just wanted to ask a quick question here. I am running GNUC 2.6.12 and when I create a invoice for a customer I have to enter an invoice number. I was thinking perhaps there is setting somewhere that I missed to get it to automatically fill in a invoice number? Id hate to have invoices with the same invoice number since I have to manually type them in right now. Thank you, jdegraw
2007 Mar 07
4
Strange Problem With Unwanted, Transient Caching
Hello, I hope somebody can explain to me what''s going on here because I''m baffled! In a controller''s action I want to create a new order for a customer. Because I post back to the same action (not RESTful I know, but that''s for another day) I use code like this: def edit @order = Order.find_by_id(params[:id]) || Order.new ... end I
2006 May 19
7
AR transactions and isolation levels
I''m trying to create a sequence with no gaps in my db (contrived example, but should work out the same as my real one), and believe db-managed transactions are the way to go about this. It''s my first real ''go'' at transactions, so I may be mistaken about how things really work. Anyway.. Consider this example code: Class Invoice < ActiveRecord::Base def