Sha256: b371bb029ec177346fe02b7bb55ed4b6df78af6b8f61897db1e3d581c3389565

Contents?: true

Size: 1.25 KB

Versions: 26

Compression:

Stored size: 1.25 KB

Contents

# sinatra_more Ideas

before/after filters only for certain routes:

    before :only => [:show, "/account"] do
     # ... actions ...
    end

    after :only => [:show, "/account"] do
     # ... actions ...
    end
 
resource routing (defines mapped routes)
    
    map(:user).resource
    # => EQUIVALENT TO:
    map(:new_user).to('/users/new') # NEW
    map(:edit_user).to('/user/:id/edit') # EDIT
    map(:user).to('/user/:id') # SHOW, UPDATE, DESTROY
    map(:users).to('/users') # INDEX, CREATE

benchmarking and logging
  
    create logger and Sinatra.logger methods
    to make logging with severity easy

    Sinatra.logger.info "Print something to log"

model generators (creates model, test, migrate)

    sinatra_gen model Article
    sinatra_gen --destroy model Article

migration generator (creates migration file)

    sinatra_gen migration CreateArticleIndices

controller generators (routes, test, helpers)

    sinatra_gen controller articles
    sinatra_gen --destroy controller articles

mailer generators (mailer file, view path, test)

    sinatra_gen mailer UserNotifier confirmation

task support (in generated app)

    padrino console
    padrino test
    padrino db:create
    padrino db:migrate
    
(Note in mailers, check out adv\_attr\_accessor)

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
sinatra_more-0.3.43 IDEAS.md
sinatra_more-0.3.42 IDEAS.md
sinatra_more-0.3.41 IDEAS.md
sinatra_more-0.3.40 IDEAS.md
sinatra_more-0.3.39 IDEAS.md
sinatra_more-0.3.38 IDEAS.md
sinatra_more-0.3.37 IDEAS.md
sinatra_more-0.3.36 IDEAS.md
sinatra_more-0.3.35 IDEAS.md
sinatra_more-0.3.34 IDEAS.md
darkhelmet-sinatra_more-0.3.36 IDEAS.md
darkhelmet-sinatra_more-0.3.35 IDEAS.md
darkhelmet-sinatra_more-0.3.34 IDEAS.md
darkhelmet-sinatra_more-0.3.33 IDEAS.md
sinatra_more-0.3.33 IDEAS.md
sinatra_more-0.3.32 IDEAS.md
sinatra_more-0.3.31 IDEAS.md
sinatra_more-0.3.30 IDEAS.md
sinatra_more-0.3.29 IDEAS.md
sinatra_more-0.3.28 IDEAS.md