Sha256: b73b95482b59acd1b6495eff3e5ac20bec68f3caea51c78eea4deada6cc2a2ee

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

<%= @class_name %>.urls do
  # map(:index).to("/")
  # map(:test).to("/test")
end

=begin

This file contains named routes to be used in the Padrino application. 
To create named routes simply add them to the urls block below.

You can specify simple routes as:

    map(:index).to("/")
    map(:test).to("/test")
  
Routes can also contain query parameters:

    map(:account).to("/the/accounts/:name/and/:id")
    
Routes can also be grouped by a namespaced:

    map :admin do |namespace|
      namespace.map(:show).to("/admin/:id/show")
      namespace.map(:destroy).to("/admin/:id/destroy")
    end
    
Routes can then be accessed in controllers and views:

    url_for(:account, :id => 1, :name => 'first')
    url_for(:admin, :show, :id => 25)
    
To define the controller actions for a named route simply refer to the alias symbol:

    # Configure the routes using the named alias
    get(:account)  { "name: params[:name] - id: params[:id]" }
    get(:accounts) { "I am the body for the url /the/accounts/index" }
    # and for namespaced routes
    namespace :admin do
      get :show do
        "admin show for #{params[:id]}"
      end
    end

=end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
padrino-gen-0.5.0 lib/padrino-gen/generators/app/config/urls.rb.tt
padrino-gen-0.4.6 lib/padrino-gen/generators/app/config/urls.rb.tt
padrino-gen-0.4.5 lib/padrino-gen/generators/app/config/urls.rb.tt
padrino-gen-0.2.9 lib/padrino-gen/generators/app/config/urls.rb.tt
padrino-gen-0.2.6 lib/padrino-gen/generators/app/config/urls.rb.tt
padrino-gen-0.2.5 lib/padrino-gen/generators/app/config/urls.rb.tt
padrino-gen-0.2.2 lib/generators/skeleton/config/urls.rb.tt
padrino-gen-0.2.1 lib/generators/skeleton/config/urls.rb.tt
padrino-gen-0.2.0 lib/generators/skeleton/config/urls.rb.tt
padrino-gen-0.1.5 lib/generators/skeleton/config/urls.rb.tt
padrino-gen-0.1.4 lib/generators/skeleton/config/urls.rb.tt
padrino-gen-0.1.3 lib/generators/skeleton/config/urls.rb.tt