Displaying 20 results from an estimated 600 matches similar to: "Simple AJAX question"
2006 Aug 18
0
AJAX question
Dear all,
Help me get a simple AJAX behavior right. I know zero AJAX, thus
please advice. Below is a simplification of the real code and I hope
I can describe my intention clearly.
class StoreController < ApplicationController
def show_cart
@cart = Cart.new
@new_item = CartItem.new
end
def add_item
@new_item = CartItem.new(params[:new_item])
if
2006 Aug 04
6
Errors ... errors and errors.
I bought the second edition of the ruby on rails, it seems to work fine
now, did some adjustments to the code. But now I get a second error and
I want to learn to understand to fix them myself. So here is the error.
ArgumentError in StoreController#add_to_cart
wrong number of arguments (1 for 0)
#{RAILS_ROOT}/app/models/cart.rb:15:in `initialize''
#{RAILS_ROOT}/app/models/cart.rb:15:in
2006 Feb 03
7
how to add multiple new records from one form
I''m trying to provide our customers with a page where they can add up to
20 items to their cart in one form. The form simply has 20 rows with
each row containing a text input for product code and a text input for
quantity.
I''ve tried having the controller create an array that has an object for
each row by looping through something like:
@new_items[1] = Cart.new
and the
2006 Jul 03
0
Page 129 of Agile Web Dev on Rails (or pg141 of pdf!)
Hi - another question, sorry....
I''m trying to get the highlighting effect to work on the current_item.
The page refreshes fine, and then I get an error as the highlighting
code is fired:
page[:current_item].visual_effect :highlight,
:startcolor => "#88ff88",
:endcolor => "#114411"
The error
2007 Sep 14
0
deal with Controller and Action logic in RJS?
The question is, should we deal with Controller and Action logic in the RJS
file? If so, is it quite "spaghetti-like"?
This is actually for the Agile Web book Shopping Cart example:
If the user clicks "Remove Item" and we do it the AJAX way,
what if we want to first show the cart''s content as
0 x Pragmatic Version Control $0.00
and then highlight
2007 Oct 15
4
ArgumentError in StoreController#add_to_cart: wrong number of arguments (1 for 0)
I am really new to Ruby and Rails but as you probably see I am trying
to get the shopping card working from the book. I am getting this
error but I really don''t know what to do. I have looked up several of
topics that stated the same problem but as far as I am, nothing has
helped me out yet. Is there something wrong with the Product model?
This is in the StoreController and I believe it
2006 Jan 10
0
Customizing autocomplete to update more than one value upon vaule select
Good day.
Currently I have a system that will successfully add a row to a table.
Each row in this table will represent a new product being added to a
purchase order.
The user can enter a quantity and then select a product code.
The product code is the auto_complete field. This field works.
However, once the user selects a product code then the values for the
product description, buy price, and
2006 Mar 26
4
Updating query results in real time with AJAX
I have the following view template:
<%= form_remote_tag :update => "new_item",
:url => {:action => ''create''},
:before => %(Element.show(''spinner'')),
:success => %(Element.hide(''spinner'')) %>
<div id="new_item">
</div>
2006 Nov 22
2
Problem with "additional" submenus
Hello all,
First off, thanks for the great work.
I have recently added "more submenus" to a functioning advanced menu
that only had one "submenu off of the main menu before" The addition of
the new submenus has caused the main menu to not function correctly and
I have been pouring over the code for several weeks and I just cannot
see the error that I have introduced. This
2006 Jun 08
19
Agile Web Dev (book) question: errors
This is kind of frustrating (but no doubt helpful in the long run) that
after following along and coding , and d/l the code the same error is
appearing.
For those who are familiar with the depot app, I''ve run into a problem after
fixing the cart to reflect quanitites. I worked through the intended error
messages but now have this appearing:
SyntaxError in StoreController#add_to_cart
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 Jul 24
1
Newbie error: undefined local variable or method
When I add an item to the shopping cart, I get an error:
undefined local variable or method `cart_item'' for
#<#<Class:0x3715a78>:0x3715a48>
Session info says the cart being updated properly. I''m just not able
to output two variables:
<%= cart_item.quantity %> × <%= h(cart_item.title) %>
I did some research, and I can grasp that local
2004 Feb 03
2
SYSLINUX 2.09-pre5 - Menu Depth "Feature"
HPA,
I believe I've found a possible bug with /menu.
This against the unmodified -pre5 snapshot.
SRC: http://www.survivaldisk.com/menutest.c
COMPILED: http://www.survivaldisk.com/menutest.com
It's easiest explained if you just compile the .c and experience it for
yourself, anyways.
If you have two submenus nested within each other and then call a third menu
it will bring up the
2008 Mar 18
14
Proposal for an improved API for Sizer (and ToolBar)
Hi all,
This is a proposal for supporting keyword arguments to Sizer#add
following the thread below :
http://rubyforge.org/pipermail/wxruby-development/2008-March/001244.html
After a deeper look at lib/wx/keyword_ctors.rb and
lib/wx/keyword_defs.rb, I understood the whole thing :-).
I just reused and modified slightly the method args_as_list.
The new Sizer#add_item combines the features of add
2004 Oct 07
1
Menu examples?
Hi all,
I'm looking for some menu examples for Murali's menu system.
Specifically, a headstart on creating a Kickstart menu which covers the
most common options with the intention of creating this:
label ks.menu
kernel vmlinuz.ks.$DIST
append ksdevice=eth0
ks=http://kickstartserver/$DIST/Custom/ks.cfg.$DIST
initrd=initrd.ks.$DIST lang= devfs=nomount ramdisk_size=8192
Hmm...looking
2006 Apr 20
0
problem in "depot" app - cart contents not shown on checkout
Hi all -
I''m working my way through the "depot" tutorial. I''m having a problem
with the section where the cart contents are displayed on the order
page. The cart contents display fine after I add an item to the cart,
but simply does not show up on the order page.
Any help would be appreciated.
I''m running Locomotive 1.0.0c on Tiger with MySQL from
2005 Dec 27
2
actions with no views?
In Depot, the demo application in the the Agile book, actions that
modify the model such as add_to_cart redirect to another action that
has a clear view role, like index, or show_cart, instead of
generating the view themselves. This uses an HTTP redirect that goes
to the client and returns.
Is this an idiomatic way to design the flow in Rails?
-- fxn
2009 Apr 12
0
[PATCH] hdt: only display MAC address for network cards
Display MAC address only for network cards not all pci devices.
- Sebastian
Index: syslinux-3.74-20-g3b80c26/com32/hdt/hdt-cli-pci.c
===================================================================
--- syslinux-3.74-20-g3b80c26.orig/com32/hdt/hdt-cli-pci.c
+++ syslinux-3.74-20-g3b80c26/com32/hdt/hdt-cli-pci.c
@@ -119,11 +119,11 @@ void show_pci_device(struct s_hardware *
2008 Jul 10
5
Uninitialized constant (controller/model)
NameError in StoreController#add_to_cart
uninitialized constant StoreController::Cart
This is the controller:
class StoreController < ApplicationController
def index
@products = Product.find_products_for_sale
end
def add_to_cart
@cart = find_cart
product = Product.find(params[:id])
@cart.add_product(product)
end
private
def find_cart
session[:cart] ||=
2006 May 22
0
logger and ActionWebService - how can I get them to work together?
I''m adding a web service to a small Rails app that I wrote to learn
the framework. This is my last piece of the puzzle and I''m having
trouble figuring out how to debug it.
I was attempting to iteratively develop the web service method using
TDD. There''s so much coercion and stuff going on via the
ActionWebService framework that I''m looking to fall-back