arguments may be 1 or 2 Integers, or 1 Range object, was: [:_root]

44 views
Skip to first unread message

ahmet

unread,
Apr 7, 2013, 5:04:11 AM4/7/13
to pak...@googlegroups.com
I am getting this error, when I am creating new post.
This is my code.

app.rb

-------------

...
action(:create) {
          post = Post.new(request.params['post'])
          post.save
          puts "after save"
          #app.redirect_to! ('posts') # This is giving error also. 
        }
...

lib 
  |
  post.rb
  ----------
 
class Post
  include DataMapper::Resource
  attr_accessor :id

  property :id,       Serial 
  property :title,    String
  property :body,     Text

end

complete error log:
---------------------------------

arguments may be 1 or 2 Integers, or 1 Range object, was: [:_root]

/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/dm-core-1.2.0/lib/dm-core/collection.rb:390:in `[]'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/bindings.rb:53:in `value_for_prop'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view.rb:477:in `bind_data_to_scope'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view.rb:297:in `bind'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:182:in `block in bind'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:129:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:129:in `block in for'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:11:in `block in each'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:11:in `each'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:11:in `each'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:127:in `each_with_index'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:127:in `for'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:181:in `bind'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-presenter/lib/presenter/view_collection.rb:193:in `apply'
/Users/ahmet/pakyoworks/dene08/app.rb:42:in `block (3 levels) in '
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:81:in `instance_exec'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:81:in `block in call_fns'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:81:in `each'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:81:in `call_fns'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:126:in `block in trampoline'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:125:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:125:in `trampoline'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/router.rb:38:in `route!'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/router.rb:10:in `block in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/router.rb:9:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/router.rb:9:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/presenter.rb:15:in `block in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/presenter.rb:14:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/presenter.rb:14:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/reloader.rb:10:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/logger.rb:14:in `block (2 levels) in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/logger.rb:13:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/logger.rb:13:in `block in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/logger.rb:32:in `time'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/logger.rb:10:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/static.rb:16:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-25bdc6b3bad7/pakyow-core/lib/core/middleware/setup.rb:11:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'


Wayne S

unread,
Apr 7, 2013, 11:45:12 AM4/7/13
to pak...@googlegroups.com
Ahmet,

Could you post the contents of your app.rb file?  I don't notice anything that looks wrong in the code you posted, maybe there is some context in the larger app.rb file that could help debug this issue.

Ahmet

unread,
Apr 7, 2013, 6:30:03 PM4/7/13
to pak...@googlegroups.com
yes, this is my app.rb file. 

require 'rubygems'
require 'pakyow'
require 'pp'
require 'dm-migrations'
require 'data_mapper'
require 'dm-tags'
require 'dm-core'

module PakyowApplication
  class Application < Pakyow::Application

    def initialize(*args)
      super
      DataMapper.finalize
      DataMapper.auto_upgrade!
    end

    config.app.default_environment = :development

    configure(:development) do
      DataMapper.setup(:default, "sqlite://#{File.expand_path(File.dirname(__FILE__))}/development.db")
      # DataMapper.setup(:default, 'sqlite:///Users/ahmet/pakyoworks/dene08/test.sqlite')
      DataMapper::Logger.new("#{File.expand_path(File.dirname(__FILE__))}/dm.log", :debug)
      DataMapper::Model.raise_on_save_failure = true

      app.log = true
      app.dev_mode = true
      app.errors_in_browser = true
      app.static = false  # keep stylesheets. 

    end


    core do
       expand(:restful, :post, 'posts') {
        
        action(:default) {
          view.scope(:post).apply(Post.all)
        }

        action(:show) {
          # show a post for params[:id]
        }
        action(:new) {
          # render a new form
          view.scope(:post).bind({})
        }
        action(:create) {
          # create the new post
          post = Post.new(request.params['post'])
          puts post.id
          puts post.title
          post.save
          puts "after save"
          #app.redirect_to! ('posts')
        }
        action(:edit) {
          # setup the form for an existing post by binding the post to the form
        }
        action(:update) {
          # update the post
        }
      }
    end

    presenter do
      scope(:post) {
        restful(:post) # post references the group created when expanding the restful template
      }
    end

  end
end



2013/4/8 Wayne S <waynes...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Pakyow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pakyow+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bryanp

unread,
Apr 8, 2013, 8:17:45 AM4/8/13
to pak...@googlegroups.com
Your code looks good, this was an issue in pakyow-presenter. I just pushed a fix (https://github.com/metabahn/pakyow/commit/9ac2f2d2a356c1bc7987a6c8da5f8b1132e669be). Update your bundle and your code should work.

Ahmet

unread,
Apr 8, 2013, 8:45:46 AM4/8/13
to pak...@googlegroups.com
I felt myself Pakyow code tester:) 
Yes, it is working now. This time I am getting these boring Warnings:

kuruchi-MacBook-Pro:dene08 ahmet$ pakyow server
[2013-04-08 21:30:20] INFO  WEBrick 1.3.1
[2013-04-08 21:30:20] INFO  ruby 2.0.0 (2013-02-24) [x86_64-darwin12.2.0]
[2013-04-08 21:30:20] INFO  WEBrick::HTTPServer#start: pid=63324 port=3000
Processing /posts (127.0.0.1 at 2013-04-08 21:36:29 +0900) [GET]
WARNING: Unbound data for post[title]
WARNING: Unbound data for post[body]
WARNING: Unbound data for post[title]
WARNING: Unbound data for post[body]
WARNING: Unbound data for post[title]
WARNING: Unbound data for post[body]
WARNING: Unbound data for post[title]
WARNING: Unbound data for post[body]
WARNING: Unbound data for post[title]
WARNING: Unbound data for post[body]
WARNING: Unbound data for post[title]
WARNING: Unbound data for post[body]
WARNING: Unbound data for post[title]
WARNING: Unbound data for post[body]
Completed in 22.367000579833984ms | 200 | [http://localhost:3000/posts]

localhost - - [08/Apr/2013:21:36:29 JST] "GET /posts HTTP/1.1" 200 3156
- -> /posts
localhost - - [08/Apr/2013:21:36:29 JST] "GET /stylesheets/bootstrap.min.css HTTP/1.1" 200 101265
http://localhost:3000/posts -> /stylesheets/bootstrap.min.css
localhost - - [08/Apr/2013:21:36:29 JST] "GET /javascripts/bootstrap.min.js HTTP/1.1" 200 25743
http://localhost:3000/posts -> /javascripts/bootstrap.min.js

main.html
-------------------

<h3>inside of the posts/main.html</h3>

<div data-scope="post">
    <h4 data-prop="title">
        Title goes here.
    </h4>

    <p data-prop="body">
        Body goes here.
    </p>
</div>

-------------------------------------------

inside of the posts/main.html

Title goes here.

Body goes here.

Title goes here.

Body goes here.

Title goes here.

Body goes here.

...


what is it meaning and how can I bound data?.




2013/4/8 bryanp <br...@metabahn.com>

bryanp

unread,
Apr 8, 2013, 9:45:02 AM4/8/13
to pak...@googlegroups.com
These warnings had been fixed in another branch. Just pulled them in to master. You shouldn't see the warnings and your data should be bound.

Ahmet

unread,
Apr 8, 2013, 10:29:56 AM4/8/13
to pak...@googlegroups.com
yes, the warnings had gone.  This time I can`t save my data in database. 
It save only id. Not title and body.  And not direct to posts default action.
maybe it is data mapper problem.  But I don`t know. 
app.rb
-----------

 action(:new) {
          view.scope(:post).bind({})
  }

 action(:create) {
          post = Post.new(request.params['post'])
          puts post.id  # save only id.
          puts post.title  # not saving?
          puts post.body  # not saving?
          post.save
          puts "after save"
          #app.redirect_to! ('posts')
 }

post.rb
-----------
class Post
  include DataMapper::Resource
  attr_accessor :id, :title, :body

  property :id,       Serial # auto-increment integer key
  property :title,    String
  property :body,     Text

end

form.html
---------------
<div id="form">

    <form action="/posts" method="post" data-scope="post" data-prop="action">

        <label>Title:</label>
        <br />
        <input type="text" data-prop="title">

        <br /><br />
        <label>Body:</label>
        <br />
        <textarea data-prop="body"></textarea>

        <br /><br />
        <input type="submit">
    </form>

</div>


2013/4/8 bryanp <br...@metabahn.com>

bryanp

unread,
Apr 8, 2013, 10:38:02 AM4/8/13
to pak...@googlegroups.com
Can you post the contents of the generated HMTL (via the browser view source) and the result of 'puts params.inspect' from the create action?

Ahmet

unread,
Apr 8, 2013, 10:57:17 AM4/8/13
to pak...@googlegroups.com
this is  puts params.inspect result:
http://localhost:3000/posts/new -> /stylesheets/bootstrap.min.css
Processing /posts (127.0.0.1 at 2013-04-08 23:53:51 +0900) [POST]
{}
after save
Completed in 6.683111190795898ms | 200 | [http://localhost:3000/posts]

and  this is whole html source

    1<!DOCTYPE html>
    2<html>
    3<head>
    4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    5<title>Bootstrap Pakyow Template</title>
    6<!-- Bootstrap --><link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
    7<script src="http://code.jquery.com/jquery-latest.js"></script><script type="text/javascript" src="/javascripts/bootstrap.min.js"></script><!-- HTML5 shim, for IE6-8 support of HTML5 elements --><!--[if lt IE 9]>
    8    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    9    <![endif]--><style>
   10        body {
   11            padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
   12        }
   13    </style>
   14<!-- Fav and touch icons --><link rel="shortcut icon" href="/favicon.ico">
   15<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/images/apple-touch-icon-144-precomposed.png">
   16<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/images/apple-touch-icon-114-precomposed.png">
   17<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/images/apple-touch-icon-72-precomposed.png">
   18<link rel="apple-touch-icon-precomposed" href="/images/apple-touch-icon-57-precomposed.png">
   19</head>
   20<body>
   21
   22<!-- Navbar
   23================================================== -->
   24<div class="navbar navbar-fixed-top">
   25    <div class="navbar-inner">
   26        <div class="container">
   27            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
   28                <span class="icon-bar"></span>
   29                <span class="icon-bar"></span>
   30                <span class="icon-bar"></span>
   31            </a>
   32            <a class="brand" href="/">Bootswatch</a>
   33            <div class="nav-collapse" id="main-menu">
   34                <ul class="nav">
   35<li class="active"><a href="/">Home</a></li>
   36                    <li><a href="/about">About</a></li>
   37                    <li><a href="/contact">Contact</a></li>
   38                </ul>
   39</div>
   40        </div>
   41    </div>
   42</div>
   43
   44<div id="wrapper">
   45    <div data-container="main">
   46<h3>inside of the posts/main.html</h3>
   47
   48<div data-scope="post">
   49    <h4 data-prop="title">
   50        Title goes here.
   51    </h4>
   52
   53    <p data-prop="body">
   54        Body goes here.
   55    </p>
   56</div>
   57</div>
   58</div>
   59</body>
   60</html>
   61




2013/4/8 bryanp <br...@metabahn.com>

bryanp

unread,
Apr 9, 2013, 12:02:00 AM4/9/13
to pak...@googlegroups.com
Sorry, I meant the generated HTML of the form.

Ahmet

unread,
Apr 9, 2013, 8:22:47 AM4/9/13
to pak...@googlegroups.com
Ok. This is  generated HTML of the form.

<div id="wrapper">
   45    <div data-container="main">
   46<h1>Post a new Message</h1>
   47<div data-container="form"><div id="form">
   48
   49    <form action="/posts" method="post" data-scope="post" data-prop="action">
   50
   51        <label>Title:</label>
   52        <br><input type="text" data-prop="title"><br><br><label>Body:</label>
   53        <br><textarea data-prop="body"></textarea><br><br><input type="submit">
   54</form>
   55
   56</div></div>
   57</div>


2013/4/9 bryanp <br...@metabahn.com>

bryanp

unread,
Apr 9, 2013, 11:13:20 PM4/9/13
to pak...@googlegroups.com
Aha. Try binding 'Post.new' instead of '{}' in the 'new' action. That should add the 'name' attributes to the fields and properly submit the data to the backend. Sorry for steering you wrong, I get used to typing shorthand sometimes :)

Ahmet

unread,
Apr 10, 2013, 9:51:08 AM4/10/13
to pak...@googlegroups.com
yes, It's working.  thanks:) how is redirect to from on action to another action?


2013/4/10 bryanp <br...@metabahn.com>

bryanp

unread,
Apr 16, 2013, 12:46:24 PM4/16/13
to pak...@googlegroups.com
Awesome!

You can redirect the request using the `redirect` helper method. Reroute to new logic using the `reroute` helper method. Here are examples of each:

redirect('/to/some/path')
reroute('/to/some/path')

Ahmet

unread,
Apr 16, 2013, 11:49:21 PM4/16/13
to pak...@googlegroups.com
yes  I do, but getting this error. 

undefined method `reroute' for #<Pakyow::FnContext:0x007f905715d080>

/Users/ahmet/pakyoworks/dene08/app.rb:73:in `block (3 levels) in '
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:81:in `instance_exec'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:81:in `block in call_fns'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:81:in `each'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:81:in `call_fns'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:126:in `block in trampoline'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:125:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:125:in `trampoline'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/router.rb:38:in `route!'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/router.rb:10:in `block in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/router.rb:9:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/router.rb:9:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/presenter.rb:15:in `block in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/presenter.rb:14:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/presenter.rb:14:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/reloader.rb:10:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/logger.rb:14:in `block (2 levels) in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/logger.rb:13:in `catch'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/logger.rb:13:in `block in call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/logger.rb:32:in `time'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/logger.rb:10:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/static.rb:16:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/pakyow-627c0a6e5242/pakyow-core/lib/core/middleware/setup.rb:11:in `call'

/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/ahmet/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'


and  I am trying like this.

module PakyowApplication
  class Application < Pakyow::Application
    include Pakyow::Helpers
...

action(:create) {
          ....

          reroute('/posts/')

        }

but  same errors are happening.


2013/4/17 bryanp <br...@metabahn.com>

bryanp

unread,
Apr 17, 2013, 7:09:36 AM4/17/13
to pak...@googlegroups.com
They are application helpers, so you will need to call `app.reroute` and `app.redirect`. Sorry for the confusion.
Reply all
Reply to author
Forward
0 new messages