Displaying 20 results from an estimated 500 matches similar to: "update or alter cart"
2007 Aug 30
3
Rails - depot application
I''m doing the depot example in the Agle Web development book. I''m
getting this error:
"undefined method `product'' for #<BigDecimal:331ce70,''0.21E1'',8(8)> "
"Extracted source (around line #9):
8: for item in @items
9: product = item.product
10: -%>
11: <tr>
12: <td><%= item.product%></td>"
2006 Apr 24
3
Form with multiple rows of content
I have looked at examples for this. I found a similar example in the
Agile Web Dev... book but that didn''t help. Here''s what i am trying to
do.
A Cart has many line items. On the Display Cart page, I want to provide
the user the option to update quantities.
Here''s the rhtml code:
<%= start_form_tag :action => ''update_cart'' %>
2005 Dec 14
9
Passing quantity in a shopping cart
I am using this line on my index.rhtml page to capture the quantity
required of a particular item for a basic shopping cart app:
<%= text_field ''line_item'', ''quantity'', {:size=>3} %> </td>
but my next screen (a cart screen) doesn''t reflect what was entered in
that text field when the item is added to the cart. That is,
2006 Sep 28
15
Inserting rows into linking table
Hi,
I have two objects:
Contacts
Lists
I want to be able to add multiple contacts to multiple lists.
I''ve created a linking table and a form that allows me to select the
contacts using checkboxes, but I''m having some problems with the
controller and model.
I receive the following error message when I submit the form:
Mysql::Error: Cannot add or update a child row: a
2006 Mar 01
2
active_record postgresql adapter problem
Instead of using numeric I created the field "unit_price" as PostgreSQL
type money. Now when I try and add a row I get the following. How do I
override AR default behaviour to cast numeric post data to money, or am
I forced to only support database types that active_record knows about?
RuntimeError: ERROR C42804 Mcolumn "unit_price" is of type money but
expression is of
2010 Feb 25
2
error using pvcm() on unbalanced panel data
Dear all
I am trying to fit Variable Coefficients Models on Unbalanced Panel
Data. I managed to fit such models on balanced panel data (the example
from the "plm" vignette), but I failed to do so on my real, unbalanced
panel data.
I can reproduce the error on a modified example from the vignette:
> require(plm)
> data("Hedonic")
> Hed <- pvcm(mv ~ crim + zn + indus
2006 Jul 08
4
Hidden fields in forms
Please can someone show me the correct syntax for a hidden field in
forms, this is my code
<%= start_form_tag :action => ''create'' %>
<div class="form1">
<table width="auto" boader="8" cellspacing="5" cellpadding="5">
<% hidden_field ''line_item'', ''client_id'', :value
2006 Aug 12
5
Simple Newbie db ???
I''m trying to simply write to a mysql db from the console.
Model = Entry , table = entries
Problem is my values keep getting turned into instance variables and end
up nil.
>> Entry.create(:title =>"new title", :body => "Brand new body")
=> #<Entry:0x27178c4 @attributes={"body"=>nil, "title"=>nil, "id"=>6},
2002 Aug 22
2
Calculating dispersion in glm
Hi all,
How is dispersion calculated within the glm function in R ?
Cheers
_________________________________________________________________
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body",
2014 Jul 17
3
FW: Selección eficiente de individuos
Hola,
Otra forma, utilizando la función de intervalos y la que comprueba si otro
intervalo se solapa del paquete "lubridate":
#----------------------
library(lubridate)
fe.chas <- data.frame(
entra=c('2001-01-01','2001-06-01','2003-01-01')
,sale=c('2002-01-01','2002-06-01','2004-01-01')
)
ref <-
2006 Jan 06
3
Where to place a global function
Hi all,
I have a little function called format_price(price) that simply formats the
argument as a dollar sign, dollar amount, dot and penny amount. Then, in
a .rhtml file, I could do this:
<%= format_price(item.unit_price * item.quantity) %>
But where do I put the format_price() function definition? The app couldn''t
find it in app/controllers/application.rb. Where do I put it
2005 Dec 23
5
Can''t get data from products into @order
I went throught the "agile web developemnt with rails" and Now I''m
trying to ''enhance'' the code with some extra options. When I go to
admin/shipping I want to include some data from the products table in
with the order info listed. I can''t seem to get this to work. in my
partial form I''m trying to add this:
<td
2006 Jun 07
8
erb Regex ?
Hi
Got a column named ''sku'' in a table named ''product''
<%= product.sku %>
...looks like this.... ''1234_56''
These last two chars (56) are an audio Track number.
I ultimately want to display:
Track <%= product.sku %>
I can isolate the first part with /\d+\_/ = 1234_
But can''t figure out how to get the last two
2003 Mar 24
2
Problem with the step() function
Dear all,
I'm having some problems with using the step() function inside another
function. I think it is an environment problem but I do not know how to
overcome it. Any suggestions are appreciated.
I've prepared a simple example to illustrate my problem:
> library(MASS)
> data(Boston)
> my.fun <- function(dataset) {
+ l <- lm(medv ~ .,data=dataset)
+ final.l <-
2014 Jul 17
4
Selección eficiente de individuos
Buenas
tardes,
Tengo un
data frame denominado “trabajadores”, que cubre desde el 1 de
enero de 1997 hasta el 30 junio de 1999, con 3 columnas: Identificador (ID), la
fecha de entrada en la empresa (ENT) y la fecha de salida (SAL). Deseo localizar
aquellos trabajadores que, durante dicho periodo, NO han llegado a pasar un 31
de diciembre y un 1 de enero seguidos (cambio de año) como asalariados
2011 Jul 29
3
help with plot.rpart
? data=read.table("http://statcourse.com/research/boston.csv", , sep=",",
header = TRUE)
? library(rpart)
? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT)
Please: Show me the tree.
Mark
-------- Original Message --------
Subject: Re: [R] help with rpart
From: "Stephen Milborrow" <[1]milbo at sonic.net>
2008 Oct 08
2
Creating a matrix
Good evening.
I have this following table and I would like to turn it into a matrix in
which my rows would be filled with de "Sellers", my columns with my
"Articles" and my data would be the mean unitary price used by each seller
in each produt.
Seller Art. Unit Price
1 v1 p1 9.148352
2 v2 p1 2.858073
3 v3 p1 3.775315
4 v4
2004 Dec 16
4
Tracktion
This is being offered gratis till the end of december by Mackie. This one
might just be coaxed into running under Wine which would be quite an
achievement.
Kudos: 1. The program, though free, needs be registered to a "machine number".
Did this under Windows, did not get that far using Wine. Might need a second
copy just for the Linux runs.
2. The program searches for all its own
2007 Mar 13
2
flac fails encoding 88.2
I do the following to init flac:
encoder = FLAC__stream_encoder_new();
e = FLAC__stream_encoder_set_do_mid_side_stereo (encoder,
numChannels == 2);
e = FLAC__stream_encoder_set_loose_mid_side_stereo (encoder,
numChannels == 2);
e = FLAC__stream_encoder_set_channels (encoder, numChannels);
e = FLAC__stream_encoder_set_bits_per_sample (encoder, jmin (24,
2006 Feb 28
2
Comment out RHTML code?
I''d like to be able to comment out a few lines of RHTML code easily.
With HTML you can just surround the code in <!-- ... -->, but if you
do that with the RHTML, it still gets executed, then the resulting
HTML is commented out. Sometimes I''d like to be able to leave the
code in but not have it evaluated..usually just for quick tests, but
sometimes I want to take the