I need some help please…
when I created web application about books market, i create a cart and
using test the message error appear like this on rake test:functionals
LineItemsControllerTest
test_should_create_line_item
ERROR
Cannot redirect to nil!
and also appear on web side, thats error told that “Cannot redirect to
nil!”
Then i was checking the code, and i think that’s nothing need to do, all
it’s normal.
somebody may have an experienced on it, please tell me how to resolve
this.
thankyou…
On 18 January 2012 04:54, muhammad singgih zulfikar ansori
[email protected] wrote:
I need some help please…
when I created web application about books market, i create a cart and using
test the message error appear like this on rake test:functionals
LineItemsControllerTest
test_should_create_line_item
ERROR
Cannot redirect to nil!
Is that all it says? Is there no stack trace? If there is show us
the complete error and stack trace (either from the test or from the
website itself), and the code around where the error is generated.
Presumably there is a redirect call there, look closely at it to see
why it might be trying to redirect to nil.
Colin
On 18 January 2012 23:38, muhammad singgih zulfikar ansori
[email protected] wrote:
app/controllers/line_items_controller.rb:50:in block (2 levels) in create' app/controllers/line_items_controller.rb:48:in
create’
That says the error is occurring in your code at line 50. Perhaps it
would be useful if you posted that area of your code so that we can
see it. Probably best to post the whole of the create method. First
though, as I suggested in my previous post, look carefully at that
code and see if you can see why it might be trying to redirect to nil.
Colin
oh sorry, here i attach the complete errors from test:
LineItemsControllerTest
`redirect_to’
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/notifications.rb:53:in
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/abstract_controller/base.rb:167:in
`block in process_action’
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/notifications.rb:53:in
process'
assert_difference’
`_run_setup_callbacks’
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:81:in
`run_callbacks’
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/testing/setup_and_teardown.rb:34:in
`run’
and here from website :
Response
Headers:
None
that’s all, all i need is to update tables of cart and product together
when i clicked at add button… but it can’t.
I want to redirect an id to cart in line item, coz line item is belongs
to
product and cart. but it say that redirect is nil!.