Displaying 4 results from an estimated 4 matches for "get_customer".
2006 Jul 20
0
Getting joined collections on a form
...invoice, :url => { :action => "create" } do |f| %>
Customer:
<%=
collection_select(:invoice, :customer_id, @customers, :id,
:name,
{:include_blank => true},
{:onchange => remote_function(:url => { :action =>
"get_customer"},
:with => "''invoice_customer_id=''+
$F(''invoice_customer_id'')")}
)
%>
<div id="customer"></div>
<%= hidden_field :invoice, :customer_id, :value => "" %>...
2006 Jul 21
0
Selecting customers and addresses in a form (was Getting joined collections on a form)
...invoice, :url => { :action => "create" } do |f| %>
Customer:
<%=
collection_select(:invoice, :customer_id, @customers, :id,
:name,
{:include_blank => true},
{:onchange => remote_function(:url => { :action =>
"get_customer"},
:with => "''invoice_customer_id=''+
$F(''invoice_customer_id'')")}
)
%>
<div id="customer"></div>
<%= hidden_field :invoice, :customer_id, :value => "" %>...
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" and "name" are existing!!
<h1> xy </h1>
<%=start_form_tag :action => ''get_article'' %>
<select name=xy>
<%= options_from_collection_for_select (@c...
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 initialize_cart
if session[:cart_id]
@cart = Cart.find(session[:cart_id])
else
@cart = Cart.create
session[:cart_id] =...