S
S
Sergey Krivochenko2013-12-09 18:42:51
ruby
Sergey Krivochenko, 2013-12-09 18:42:51

Routing in Ruby on Rack?

Good day to all. I am writing a small web application. I haven't touched Sinatra and Rails yet.
In config.ru:

require 'rubygems'
require 'rack'

map '/index' do
  require './index'
  run Index.new
end
map '/about' do
  require './about'
  run About.new
end

So far so good, but I would like to write something like:
map '/articles/:id' do
  #тут выбираем статью по идентификатору
end

So far, all attempts and searches have been unsuccessful. Thank you all in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2013-12-09
@krivochenko

You need gem http_router

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question