You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Worth noting here is that sinatra_more is still undergoing minor bug fixes and I will manage pull requests but development has stopped. The reason for this is that this project has been superseded by another project called the Padrino Framework. Padrino is definately the place to look in the future for modular extensions to Sinatra. Note that Padrino contains everything from sinatra_more but is fa
12345678910111213141516171819202122232425262728 link_to 等のヘルパメソッドは sinatra 本体には含まれていませんが、 sinatra_more という gem が用意されています。 install shell>> % gem install sinatra_more <<-- standalone 利用の場合 直接 Sinatra::Base に register してしまいましょう。 ruby>> require 'sinatra' ... require 'sinatra_more/markup_plugin' Sinatra::Base.register SinatraMore::MarkupPlugin ... get '/' do ... <<-- クラス利用の場合 該当クラスで register します。 ruby>
まずSinatra gem install rack -r gem install mongrel -r gem install sinatra -r で hello.rb という名前で以下のソース保存して require 'rubygems' require 'sinatra' get '/' do "Hello, sinatra" end ruby hello.rbで動く Haml gem install sinatra-haml -r gem install haml -r require 'rubygems' require 'sinatra' get '/' do haml <<HAML %h1 Hello haml & sinatra HAML end ruby hello.rb で実行 http://localhost:4567/にアクセスして動作確認 Shotgun gem
This page is also available in English. 始めよう SinatraはRubyで下記のような最小労力で手早くウェブアプリケーションを作成するためのDSLです。 # myapp.rb require 'rubygems' require 'sinatra' get '/' do 'Hello world!' end gemをインストールして動かしてみる。 sudo gem install sinatra ruby myapp.rb localhost:4567 を見る。 ルート Sinatraでは、ルートはHTTPメソッドとURLマッチングパターンがペアになっています。 ルートはブロックに結び付けられています。 get '/' do .. 何か見せる .. end post '/' do .. 何か生成する .. end put '/' do .. 何か更
Sammy What Sammy is a tiny javascript framework built on top of jQuery. It’s RESTful Evented JavaScript. Why jQuery is probably the fastest, most robust way to abstract basic low-level Javascript functionality that every Javascript developer needs. However, it really remains low-level and does not imply any structure or organization for larger scale Javascript applications. Working heavily with Si
はじめに 第7回はRails以外のWebフレームワークの簡単な紹介と、SinatraでHello Worldアプリケーションを動かすところまでを解説しました。今回はSinatraで実際のアプリケーションを作り、SequelとHamlという2つのライブラリを紹介します。 Sinatraの特徴は、CGIスクリプトのようにファイル一つからアプリケーションが書ける気軽さです。CGIスクリプトといえば、代表的なものは何と言っても掲示板(BBS)です。そこで、今回はSinatraで掲示板アプリを作ってみました。ソースコードが少し長めなので、githubにて全文を公開しています。適宜参照しながら読み進めて下さい。ファイル構成は以下のようになっています。 start.rb アプリケーションの本体。 model/comment.rb 掲示板の書き込みを表すモデルの定義。 view/index.haml トッ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く