Sinatra & Rails 3 routes issue -
i have setup sinatra v1.1.0 inside rails (v3.0.1) app. can't invoke routes more 1 level deep, meaning works - http://localhost/customer/3,
but 1 not work - http://localhost/customer/3/edit , "routing error"
here's sinatra object
class customerapp < sinatra::base # works "/customer/:id" "hello customer" end # not work "/customer/:id/edit" "hello customer" end end
this have in rails routes.rb file -
match '/customer/(:string)' => customerapp
i guessing need magic in routes file? problem?
in routes file, can specify mapping way:
mount customerapp, :at => '/customer'
now, inside sinatra application, can specify routes without /customer
part. dont't forget require sinatra application somewhere (you can directly in route file)
Comments
Post a Comment