
Sinatraã£ã¦ãããRackã®ããã«ã¦ã§ã¢ã§ããã¾ããã sudo gem install rack_csrf# app.rb require 'rubygems' require 'sinatra' require 'rack/csrf' get '/' do @msg = 'Hello World' erb :index end post '/' do @msg = 'Hello CSRF' erb :index end configure do set :app_file, __FILE__ use Rack::Session::Cookie, :secret => 'change me' use Rack::Csrf, :raise => true end helpers do def csrf_token Rack::Csrf.csrf_token(env) end def
Passenger, rackã¨sinatraã§Premature end of script headers ãªãã ããã¼ ããã£ã¦æã£ã¦ãã®ã§ãããæ¡å¤ç°¡åã«è§£æ±ºãã¾ããã config.ruãåé¡ã ã£ãã½ãã passenger 2.0.5 rack 0.9.1 sinatra 0.9.0.2 $ cat config.ru require 'rubygems' require 'sinatra' ROOT_DIR = File.expand_path(File.dirname(__FILE__)) Sinatra::Default.set(:run, false) Sinatra::Default.set(:environment, :development) Sinatra::Default.set(:views, File.join(ROOT_DIR, 'views')) Si
RailsTips One man, lazily posting some of the things he learns. subscribe » Figure #1: Example Directory StructureSinatra is a DSL for quickly creating web-applications in Ruby with minimal effort, as quoted from the Sinatra website. It is great for really simple, really fast services and in general is fun to make apps with. Since I showed how to deploy your Rails apps on Dreamhost, I thought I wo
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãç¥ãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}