Sha256: e6c7f24047504eb420ff8feaee8e539413d0d86283e8f1946b081f67a0847666
Contents?: true
Size: 680 Bytes
Versions: 59
Compression:
Stored size: 680 Bytes
Contents
module Lalala::Pages::RouteMapper # pages(:about, to: 'about#show') # pages(:about, to: 'about#show') do # get '/team/:member', to: 'about#team_member' # end # pages(:about) do # get '/team/:member', to: 'about#team_member' # end def pages(*args) options = args.extract_options! options = options.dup unless args.size == 1 and Symbol === args[0] raise ArgumentError, "expected a page type" end type = args[0] options = { as: type }.merge(options) options[:constraints] = Lalala::Pages::PageTypeConstraint.new(type) match '/', options if block_given? scope(options) { yield } end self end end
Version data entries
59 entries across 59 versions & 1 rubygems