On Feb 25, 2010, at 9:29 AM, Aldo Italo wrote:
> i have a problem with generating a url with the helper.
>
>
> in the routes.rb:
>
> # cats
> map.cat ''/category/:id/:page'', :namespace =>
''front'', :controller =>
> ''cats'', :action => ''cat'',
:requirements => { :page => /\d+/ }, :page
> =>
> nil
> map.cat ''/category/:id'', :namespace =>
''front'', :controller => ''cats'',
> :action => ''cat''
Why do you have two routes named the same thing ("cat")? Get rid of
the second one since you''re allowing page to be nil in the first.
I think the error your getting is because cat_url is trying to match
against "/category/:id" which only has a single argument and
you''re
supplying two and it''s complaining about that.
>
> when the url is generating from will_paginate plugin helper it work
> fine.
> but if i want to set my personal helper to build the url with the
> page,
> example:
>
> <%= cat_url( @obj.id, var_numb_page ) =>
> where "var_numb_page" is a integer indicates the :page param
>
>
> i have this error:
>
> undefined method `has_key?'' for 2:Fixnum
>
>
>
> i not understand where is the problem.
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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-/JYPxA39Uh5TLH3MbocFFw@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.