ROADMAP in sinatra_more-0.3.13 vs ROADMAP in sinatra_more-0.3.14
- old
+ new
@@ -16,41 +16,13 @@
* sinatra-core (the existing sinatra framework) <= from Sinatra
* sinatra-helpers (adds the markup and renderer helpers) <= from MarkupPlugin, RenderPlugin
* sinatra-mailer (mail handling for sinatra applications) <= from MailerPlugin
* sinatra-gen (easy generation of and for sinatra apps) <= from Generator
* sinatra-admin (admin management dashboard for content) <= from Lipsiadmin (ported)
+ * sinatra-routing (sinatra route mapping system) <= from RoutingPlugin
* sinatra-cache (page and fragment caching support)
- * sinatra-mapping (sinatra route mapping system)
-'sinatra-mapping' Routing Concept:
-
- namespace :admin do
- get :show do
- ...
- end
- end
-
- get :accounts do
- ...
- end
-
- map(:admin, :show).to("/my-admin/:id/show")
- map(:accounts).to("/show-me-my/accounts")
-
- # or
-
- map :admin do |namespace|
- namespace.map(:show).to("/my-admin/:id/show")
- end
-
- # and to use
- link_to "Show Admin", admin_show_path(:id => 5)
- link_to "Accounts", accounts_path
- # or maybe
- link_to "Show Admin", url_for(:admin, :show, :id => 5)
- link_to "Accounts", url_for(:accounts)
-
'sinatra-cache' Caching concept:
# in models
class Person
def something_expensive
@@ -73,6 +45,31 @@
= partial 'item', :collection => @items
# page
get '/example', :cache => true do
haml_template 'accounts/index'
- end
+ end
+
+'sinatra-routing' Routing Concept:
+
+ namespace :admin do
+ get :show do
+ ...
+ end
+ end
+
+ get :accounts do
+ ...
+ end
+
+ map(:admin, :show).to("/my-admin/:id/show")
+ map(:accounts).to("/show-me-my/accounts")
+
+ # or
+
+ map :admin do |namespace|
+ namespace.map(:show).to("/my-admin/:id/show")
+ end
+
+ # and to use
+ link_to "Show Admin", url_for(:admin, :show, :id => 5)
+ link_to "Accounts", url_for(:accounts)
\ No newline at end of file