Displaying 20 results from an estimated 20000 matches similar to: "Different log file per controller"
2007 Oct 18
0
REST help
Hi all,
I am trying to build a RESTful shopping cart and I have hit a small
wall, but before I get to that let me explain what I have done thus far.
I have two RESTful controllers, CartController and CartItemsController
with a nested routes setup like so
map.resources :carts do |carts|
carts.resources :cart_items, :collection => {:empty => :delete}
end
(I added a custom route to
2007 Sep 22
0
How to DRY up controller action spec with different params.
I tend to write a fresh description block for every change in the parameters
for that specific action, because I hate conditionals in the example
describtion, e.g.:
describe SomeController, "handling GET /path/with/param/3" do
it "should do this"
it "should not do this if"
it "should still do that in both cases"
end
Seperate description blocks keep
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
2008 Oct 28
5
Page does not seem to be reloaded on prod server
Hi all
I''ve coded a small shop that works well on my dev machine (OSX 10.5).
But look at the following page:
http://shop.incense.ch/compact_discs/1
When clicking "Reservieren", the page is forwarded to a new page, where
the product is added to the shopping cart, and a flash notice is
prepare. Then the page is redirected back to the shop page.
On my dev machine this works
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] ||=
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
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
2006 Jul 10
2
cross controller functional tests?
Hi,
I have an online store and I would like to simulate a complete
shopping trip which involves several controllers? How can I write a
test that calls actions from different controllers in a particular
sequence? Something like the following which involves department,
product, cart_item, and cart controllers.
get department 5
check it has a link to product 4
get product 4
post cartitem/create
get
2012 Apr 13
0
[LLVMdev] Support for "foreign" Visual Studio 64 bits C++ exceptions?
On Thu, Apr 12, 2012 at 2:02 PM, Jérôme Couture-Gagnon
<Jerome.Couture-Gagnon at fabricengine.com> wrote:
> Hi,
>
> We are currently porting our application to Windows 64 bits (amd64), and we
> are getting regressions from 32 bits relatively to LLVM 3.0's ability to get
> traversed by "foreign" Visual Studio C++ exceptions. That is, there is a
> crash when C++
2015 Oct 14
0
custom port in cwrsync gui client for windows
2015-10-13 19:40 GMT-04:00 Richard Couture <rrc at linuxcabal.org>:
> Note that my original post had -rave as the r is for recursive.
>
recursive is implied by -a. In other words, -rave is the same as -ave
>
> I have it working with cmd files, but the point is that I purchased the
> GUI to avert the need to send windows users to the command line, which they
> refuse to
2012 Apr 04
10
Unable to boot installation ISO
Hi,
I build Xen 4.1.1 on a Gentoo base dom0. Everything is working great. I tried one of Joseph Glanville''s PV-HVM image (debian6) and its working as it should.
Now l''im trying to build a Gentoo based domU with then same specs as Joseph''s PV-HVM.
I used a copy of the .cfg and adapted to my needs to make the gentoo work.
when booting the minimal install image using
2006 Feb 02
6
How do I? Same Model, Different Controllers, Different Validations?
Hi all --
The simple question is: How do I set different validations for the same
Model, when accessed in different Controllers?
Here''s the scenario: I have a store/cart app, with a customer-facing
shopping cart, and a typical Admin side. The Admin side also has an
Order Entry component, where our staff can enter orders received by fax,
telephone, etc. Both the customer-facing cart
2011 Mar 05
2
[XCP] No network after upgrade from 0.5 to 1.0
Hi guys,
I upgraded my home server to check out XCP 1.0 but i have a big problem.
After the upgrade my network just died.
I see the card, it''s listed as xenbr0 but there is no network
acces/connection going over it. A ping to or from the server results in
nothing.
When i check out the configure managment interface settings i see the NIC,
and it states connected. But there is no way to
2009 Jun 26
0
R 2.9.1 is released
I've rolled up R-2.9.1.tar.gz a few hours ago.
This is a maintenance release and fixes a number of mostly minor issues.
See the full list of changes below.
You can get it from
http://cran.r-project.org/src/base/R-2/R-2.9.1.tar.gz
or wait for it to be mirrored at a CRAN site nearer to you. Binaries
for various platforms will appear in due course.
For the R Core Team
Peter
2009 Jun 26
0
R 2.9.1 is released
I've rolled up R-2.9.1.tar.gz a few hours ago.
This is a maintenance release and fixes a number of mostly minor issues.
See the full list of changes below.
You can get it from
http://cran.r-project.org/src/base/R-2/R-2.9.1.tar.gz
or wait for it to be mirrored at a CRAN site nearer to you. Binaries
for various platforms will appear in due course.
For the R Core Team
Peter
2009 Nov 01
5
Headache with sessions being shared.
I have a really horrendous problem with sessions.
before_filter :find_cart_from_session
private
def find_cart_from_session
if session[:cart] # if there''s is a cart in the session
begin
@cart = Cart.find(session[:cart]) # return existing or new cart
rescue ActiveRecord::RecordNotFound
@cart = Cart.create
@cart.save
session[:cart] = @cart.id
2006 Oct 17
2
tcltk crashes with bad color with text widget
Hello
I have been playing with tcl/tk in R 2.4.0 on windows XP and have
managed to crash R by supplying tcl/tk with an incorrect color.
Is this a bug? is there a way for me to test the color to see if it is a
valid tcl/tk color, to avoid this?
tt=tktoplevel()
tklabel(parent=tt, text="hello world", foreground="reed")
Error in structure(.External("dotTclObjv", objv,
2007 May 30
2
Depot - empty_cart with ajax
First of all id like to say hi to everyone from Argentina, im yet
another Depot first-timer.
Going through the example, i got to the point where my cart finally
runs Ajax-based. And there is a line where Dave says, after all the
job is done "You should see the cart in the sidebar update. And you
shouldn''t see your browser show any indication of reloading the page.
You''ve
2006 Apr 18
1
''depot''app, trouble with session / cookies
Many of you probably know the ''depot'' app from the ''Agile Rails
development'' book.
When the view changes from ''Store'' to ''display_cart,'' a session
containing the shopping-cart (:cart) is supposed maintain the ''cart''
between calls, but when the display_cart stub view shows up, I have
always ZERO elements
2007 Feb 07
1
The Depot "Add to Cart" sessions question (2.ed agile book)
Hello,
Im in the process of working my way through the 2.ed of the agile book.
As many of you already know, the book goes through the regular
development cycle of the Depot application. I have hit a wall
when they started talking about the sessions and the exact mechanics of
how an item is added to the session.
The code looks like this:
depot/app/controllers/store_controller:
def add_to_cart