Pakyow Method 0.9 undefined

I just upgraded to Pakyow 0.9. When I try to run pakyow server

on an existing Pakyow project, I get the following error.

~/.rvm/gems/ruby-2.1.0/bundler/gems/
  pakyow-2ccd6109e47c/pakyow-core/lib/core/route_eval.rb:334:
  in `action': undefined method `[]' for nil:NilClass (NoMethodError)
from .../appname/app/lib/routes.rb:81:
  in `block (2 levels) in <top (required)>'
...

      

Here's some more information.

ruby -v
=> ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin14.0]

gem which pakyow
=> ~/.rvm/gems/ruby-2.1.0/gems/pakyow-0.9.1/lib/pakyow.rb

      

It seems to be configured correctly.

+3


source to share


1 answer


In 0.9, the action delete

was renamed to remove

(as described in the release notes ). Try changing lines 81-83 of the .rb routes to:

action :remove do
  Note[params[:note_id]].destroy
end

      



You can even write it without action

like:

remove do
  Note[params[:note_id]].destroy
end

      

+2


source







All Articles