Displaying 20 results from an estimated 110 matches similar to: "expanding details examples?"
2007 Aug 05
0
Newbie - Question on Parent child updating
All,
I''ve just started Rails and Ruby a week or so ago. Please forgive me
for my ignorance. I started writing a small test application to test
some of my new knowledge and have hit a wall. Would like some best
practices.
I have 3 tables, as below...
CREATE TABLE `carts` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`quantity` int(11) NOT NULL,
PRIMARY
2007 Jul 14
3
expect_render twice in views
I found this:
controller.expect_render(:partial => ''thing'', :collection => things).once
but I am trying to expect_render twice in my view spec:
template.expect_render(:partial => ''order_details'').twice
This doesn''t work as the template.expect_render call seems to be
returning an array. Is it possible to expect the rendering of a
partial
2006 Jul 26
0
error when updating table with select box
trying to update a table with form input from a select box and getting
this error: "Options does not specify :except or :only"
#View:
<%= start_form_tag :action => ''order_update'', :id => @order %>
<div>
Status <br />
<select name="order[shipping_status]">
<option>None</option>
<option>Paid</option>
2006 Jun 04
3
Ajax table does not update
I have two models: Child and Day. A Child has many days, and a day
belongs to a child.
I want to create ana ajax table listing the children and, after pressing
a button, I want to show the days that belong to that child.
Here is my code:
(list.rhtml)
<table>
<tr>
...
<td><%= link_to ''Days'', :action => ''show_days'', :id =>
2006 Apr 07
5
RJS support "toggle" effect?
Does RJS inherently support the Element.toggle effect? I haven''t been
able to call it the way you call "appear", "fade", etc...
Jeff
--
Posted via http://www.ruby-forum.com/.
2006 Dec 02
0
Fwd: Re: Mocha and ActiveRecord
---------- Forwarded message ----------
From: J. B. Rainsberger <jbrains762 at gmail.com>
Date: 02-Dec-2006 02:48
Subject: Re: Mocha and ActiveRecord
To: ruby-talk ML <ruby-talk at ruby-lang.org>
James Mead wrote:
> On 28/11/06, J. B. Rainsberger <jbrains762 at gmail.com> wrote:
>>
>> Suppose I have an Order, which has_many OrderItems. Suppose I want to
>>
2006 Apr 14
3
Updateform with a has_many relationship ?
Hello all,
I would like to be able to update the "amount" of a certain item in
me order list.
The problem I run into is how to define the text_field element.
@order is the current order, which has_many :order_item which in turn
belongs_to :order.
order_item has a field "amount" which should be modified...
What I tried is this below, but I get a undefined method
2006 Jul 11
0
using acts_as_list storing the information in a session
Hi,
I have an order model that i am storing in a session, that is not
currently in the database. I am updating the page using ajax, and I do
not want to store the order in the database untill it is completely
filled out.
I have order_items that I am adding to the order, and I have used the
acts_as_list within the order_item model.
My problem comes when i try and rearrange the order_items
2006 Feb 20
0
YAML and has many associations
Hi,
I have the following:
order = YAML::load(order_yaml)
The YAML contains order_items too, and my order model has a has_many to
order_items.
When I do order.order_items, I don''t want Rails to go the db to get the
order_items, but use the order_items already contained in the object
created from the YAML.
How would I do this?
Thanks
Joerg
--
Posted via
2006 Mar 14
5
GROUP BY and SUM
I have orders, order_items, and products.
I want to collate several orders so that I can get a SUM of quantities
ordered for each product etc.
Can I say something like (the below gives an error on :sum, and ignores
:group)
OrderItem.find(:all, :sum => ''quantity'', :group => ''product_id'',
:include => [:order, :product])
I want to get back a
2006 Mar 09
1
[TIP] Making an intelligent form fields
After searching arround I found a quite smart solution to me for binding
form fields to model in an active way. I use aggregations with single
value objects such as
class Percentage
attr_accessor :value
def initialize(value)
@value = (value.is_a? String) ? value.tr('' %'', '''').to_f : value
end
def to_s
return unless value
2006 Jun 26
1
RJS visual_effect toggle?
Is there a way to toggle an effect in an RJS? If not, anyone have
recommendations for how to manually make it toggle? I guess I would
assume some boolean that the rjs checks everytime it''s called and
depending on whether it''s true or false it will do page.visual_effect
:appear or page.visual_effect :hide
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Mar 13
8
Nested find(:all, :include => ) statements
Is there a way for me to do:
OrderItem.find(:all, :include => [:user, :product => [:supplier]]
So I don''t have a supplier_id on my order_item, but have it on my
product, which is part of order_item.
Joerg
--
Posted via http://www.ruby-forum.com/.
2007 Oct 13
4
Chapter 9
Hello,
I''m currently stunk on this issue for few days and I do not know how
to get it fixed.
The system always raises this error message :
order is closed
and here is my order.rb:
class Order < ActiveRecord::Base
include ActiveMerchant::Billing
before_validation :set_status
attr_protected :id, :customer_ip, :status, :error_message, :updated_at, :created_at
attr_accessor
2006 Jul 06
7
form_remote_tag submitting to an rjs file.
I have the following form that I am trying to use, but for some reason,
the form gets submitted with out the params values.
<%= form_remote_tag(:url => { :action => :add_item_to_order }) %>
<tr>
<td>
<%=collection_select(:order_item , :item_category_id,
@item_categories, :id, :name)%>
</td>
<td>
<%= text_field
2006 May 23
5
text_field_with_auto_complete
I am having some trouble using `text_field_with_auto_complete'' in
Firefox. For some reason, the drop-down list is being rendered
behind other table elements.
Firefox (broken): http://schema.ca/broke.png
Safari: http://schema.ca/safari_works.png
I''m wondering if anyone is aware of this problem, and what I might be
able to do to work around it?
Thanks,
-Mike
2005 Dec 30
2
newbie
Hello There
I new to rails development and looking to write a simple site using
rails. Does any one know of and example ecommerce application that that
I can use as a base to build from. My db schema is very
simple--product, categories, orders and order_item tables. Any
suggestions will be highly appreciate.
Thanks
Pat
2006 Apr 20
2
Additional Fields in a Join Table
Hi,
I am creating an order management web application, and have run into an
issue over join tables. I am reading Agile Web Development and it says
that I can put additional fields within my join tables, and they give
the example of a date field.
I want to know if it is possible to do the following:
I have an orders table with the order information as well as an
orders_items table and an
2006 Sep 08
1
testing question
ok, i''ve written a couple of unit tests and it was pretty straight
forward as far as what i should and shouldn''t be testing in the unit
test.. until now.
i am testing a customer model right now.. i figure that a unit test
should test the functions of a model as well as if you can do all the
crud stuff and validations. right now i wish to test a customer model
function that
2015 Jan 28
2
"Monitor" RPMs in Repo
Hi all,
Sorry for the bad subject. I'd like to do two things.
- Know when a RPM which is currently in only one repository pops up in a
different repository. E.g. RPM going from epel-testing to epel.
- Get notified when a RPM pops up in a repository. E.g. waiting for an
RPM to appear.
I know that this is quite easy to find out manually. But did anyone
build a script or something else to do