#1213 confirmed
Jacques Crocker

url(:this) not accurate for some resources

Reported by Jacques Crocker | January 31st, 2009 @ 03:25 AM | in 1.2

Inside my router action (and views), when I use url(:this) in my resource's "show" action, I get an invalid url.

My url is: "/all/sss" (where sss is my :id)

When I use url(:this), it returns: "/all/pick"

It seems to be matching the wrong route. When I use request.route, I get the Route object for my :pick collection.

Here is my router

Merb::Router.prepare do
  resources :categories, :path => "all" do
    collection :pick, :method => :get
  end
end

Here is my controller

class Categories < Application
  def show
    "THE CURRENT URL IS: "+url(:this)
  end
end

Navigate to /all/sss and you'll see the breakage

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Attachments

Tags

Pages