Displaying 20 results from an estimated 30 matches for "unit_prices".
Did you mean:
unit_price
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
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 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'' %>
2006 Jul 15
0
Validate using boolean values
...em: how to do the validation. I have not written it
correctly!!!
Given two tables: sizes and prices;
with a relation: has_many ,belongs_to
a Price.unit_price for a given Size.meassure must be
marked ''true'' as the standard unit_price for that meassure.
There will be many other unit_prices for a given meassure, those must be
marked ''false''
table sizes
meassure, :string (ie.small, medium, big)
Model Size
has_many :prices
table prices
price_name :string
unit_price :integer
standard :boolean
size_id :integer
Model Price
belongs_to :size
I have tried both of t...
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
2006 Aug 15
3
update or alter cart
I want to modify and update the items in the Depot - "display_cart".
Since the cart is in a session, its a little hard to get at the data.
I just want to create a way to change quantities, prices and
recalculate.
Has someone done this, and could you point me to the right direction.
Thanks
Chas
--
Posted via http://www.ruby-forum.com/.
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
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 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
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
2006 Aug 14
1
NoMethodError
Hello,
When i test this code
<h1>contenu de votre panier</h1>
<table>
<%
for item in @items
product = item.product
%>
<tr>
<td><%= item.quantity %></td>
<td><%= h(product.title)%></td>
<td align="right"><%=item.unit_price %></td>
<td align="right"><%=item.unit_price * item.quantity
2006 Mar 22
1
How to retrieve attribute values of objects?????
Hi,
I am writing following line in my code:-
=================
@product1=Product.find(:all, :conditions => ["id = ? ",
params[:product][''product_id''+count.to_s]])
print @product1.inspect
===========================
So I am getting on console following output.
==========================
[#<Product:0x3cd61c8 @attributes={"demand"=>nil,
2006 Feb 22
0
Need help getting value from text_field_with_autocomplete
Good day.
I have setup of a text field with auto complete and I need to grab the value
from that text field and pass it into a method to update a row in a table.
Here is the view:
<tr>
<td align="center" colspan="6"><%= text_field_with_auto_complete(
:product, :product_code ) %></td>
</tr>
<tr>
<td
2006 Feb 27
1
Odd problem in Agile tutorial
I am getting an undefined method error in my cart.rb class when trying
to find in an array. I cannot see what my error is. Perhaps a view
more eyes can help me with this:
#---------------------------------------------------------------
1 class Cart
2
3 attr_reader :items
4 attr_reader :total_price
5
6 def initialize
7 @items = []
8
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
2011 Jun 15
0
Year cost optimisation
Hi,
I have a data file with all our purchases from last year,
it contains the unit price, count, and total dollars spend.
Now I'm looking for some way to "classify" all our purchases to find out
which purchases are the best ones to find cheaper alternatives.
for example: if we only buy 1 item of a product which costs 5 dollar, we
maybe can find a cheaper product of 4.5 dollar, but
2006 Aug 07
0
Re:
>From: Josh Kieschnick <jjkiesch@...>
>Subject: Re: "Undefined method" problem in "Agile Web Development Wit
>Newsgroups: gmane.comp.lang.ruby.rails
>Date: 2006-03-22 04:39:56 GMT (19 weeks, 4 days, 23 hours and 8 minutes ago)
>I am working through that book as well. I am getting the exact same
>error. I thought it was something I did wrong but I have no
2006 Mar 17
1
How to update values in database in this form?
Hi,
This is my rHtml page & Corresponding actions & model pages:-
===listform.rHtml=================
<h1>Products List</h1>
<%= start_form_tag(:action => "add_to_cart")%>
<table>
<tr>
<%
i=0
%>
<th>
Product No.
</th>
<th>
Unit Price
</th>
<th>
Available Qty.
</th>
<th>
Demand Qty.
</th>
2007 Feb 16
4
Ideas for rails
Here are a few suggestions, wondering what others thought:
When you generate a model for a DB table, it would be nice if the
model.rb contained the DB schema (kind of like # commented out schema)
right in the model file. This would make reference WAY easier and put
all of the DB stuff in one easy file. Thanks.
also nice, of course, woudl be for rails to try and ''guess'' the