Sha256: ecf6c9f516c7b4666018566ba26268074c4839e0fd9e0b052ef64cda962b3b96

Contents?: true

Size: 1.67 KB

Versions: 7

Compression:

Stored size: 1.67 KB

Contents

# Rasti::Web

[![Gem Version](https://badge.fury.io/rb/rasti-web.svg)](https://rubygems.org/gems/rasti-web)
[![Build Status](https://travis-ci.org/gabynaiman/rasti-web.svg?branch=master)](https://travis-ci.org/gabynaiman/rasti-web)
[![Coverage Status](https://coveralls.io/repos/gabynaiman/rasti-web/badge.svg?branch=master)](https://coveralls.io/r/gabynaiman/rasti-web?branch=master)
[![Code Climate](https://codeclimate.com/github/gabynaiman/rasti-web.svg)](https://codeclimate.com/github/gabynaiman/rasti-web)
[![Dependency Status](https://gemnasium.com/gabynaiman/rasti-web.svg)](https://gemnasium.com/gabynaiman/rasti-web)

Web blocks to build robust applications

## Installation

Add this line to your application's Gemfile:

    gem 'rasti-web'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rasti-web

## Usage

### Routing

```ruby
# app.rb
class WebApp < Rasti::Web::Application

  use SomeMiddleware

  get '/hello' do |request, response, render|
    render.text 'world'
  end

  put '/users/:id', UsersController >> :update

end

# configu.ru
require_relative 'app'
run WebApp
```

### Controllers

```ruby
class UsersController < Rasti::Web::Controller

  def update
    user = User.find(params[:id])
    if user.update_attributes(params[:user])
      render.view 'users/list', users: User.all
    else
      render.view 'users/edit', user: user
    end
  end

end
```

## Contributing

1. Fork it ( https://github.com/gabynaiman/rasti-web/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rasti-web-1.1.0 README.md
rasti-web-1.0.0 README.md
rasti-web-0.2.3 README.md
rasti-web-0.2.2 README.md
rasti-web-0.2.1 README.md
rasti-web-0.2.0 README.md
rasti-web-0.1.1 README.md