oh sorry, here i attach the complete errors from test:
LineItemsControllerTest>
> test_should_create_line_item
>> ERROR
>
> Cannot redirect to nil!
>
> STDERR:
>
> Exception `ActionController::ActionControllerError'' at
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/redirecting.rb:60:in
>> `redirect_to''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/flash.rb:25:in
>> `redirect_to''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/instrumentation.rb:60:in
>> `block in redirect_to''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/notifications.rb:53:in
>> `block in instrument''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/notifications/instrumenter.rb:21:in
>> `instrument''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/notifications.rb:53:in
>> `instrument''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/instrumentation.rb:59:in
>> `redirect_to''
>
> app/controllers/line_items_controller.rb:50:in `block (2 levels)
>> in create''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/mime_responds.rb:195:in
>> `call''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/mime_responds.rb:195:in
>> `respond_to''
>
> app/controllers/line_items_controller.rb:48:in `create''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/implicit_render.rb:4:in
>> `send_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/abstract_controller/base.rb:167:in
>> `process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/rendering.rb:10:in
>> `process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/abstract_controller/callbacks.rb:18:in
>> `block in process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:416:in
>> `_run__909953372__process_action__930268695__callbacks''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:386:in
>> `_run_process_action_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/actionpack-3.1.3/lib/abstract_controller/callbacks.rb:17:in
>> `process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/rescue.rb:17:in
>> `process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/instrumentation.rb:30: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
>> `block in instrument''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/notifications/instrumenter.rb:21:in
>> `instrument''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/notifications.rb:53:in
>> `instrument''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/instrumentation.rb:29:in
>> `process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/params_wrapper.rb:201:in
>> `process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/railties/controller_runtime.rb:18:in
>> `process_action''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/abstract_controller/base.rb:121:in
>> `process''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:45:in
>> `process''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/metal/testing.rb:17:in
>> `process_with_new_base_test''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/test_case.rb:449:in
>> `process''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/test_case.rb:49:in
>> `process''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/action_controller/test_case.rb:370:in
>> `post''
>
> test/functional/line_items_controller_test.rb:21:in `block (2
>> levels) in <class:LineItemsControllerTest>''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/testing/assertions.rb:55:in
>> `assert_difference''
>
> test/functional/line_items_controller_test.rb:20:in `block in
>> <class:LineItemsControllerTest>''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/testing/setup_and_teardown.rb:35:in
>> `block in run''
>
>
>>
/home/hirokakaoshi/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:444:in
>> `_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 :
> ActionController::ActionControllerError in LineItemsController#create
>
> Cannot redirect to nil!
>
> Rails.root: /home/hirokakaoshi/Project/RoR/depot
> Application Trace <http://localhost:3000/line_items?product_id=10#> |
Framework
> Trace <http://localhost:3000/line_items?product_id=10#> | Full
Trace<http://localhost:3000/line_items?product_id=10#>
>
> app/controllers/line_items_controller.rb:50:in `block (2 levels) in
create''
> app/controllers/line_items_controller.rb:48:in `create''
>
> Request
>
> *Parameters*:
>
>
{"authenticity_token"=>"ffpMM03w5smCVm9JfyphEaWBQA1wDg6nphecslhJ1Y8=",
> "product_id"=>"10"}
>
> Show session dump <http://localhost:3000/line_items?product_id=10#>
>
> Show env dump <http://localhost:3000/line_items?product_id=10#>
> 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!.
On Wed, Jan 18, 2012 at 4:11 PM, Colin Law
<clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> On 18 January 2012 04:54, muhammad singgih zulfikar ansori
> <m.singgih.za-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.