Created
April 15, 2011 12:48
-
-
Save zenlor/921638 to your computer and use it in GitHub Desktop.
app.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra/base' | |
| require 'padrino-helpers' | |
| class SimpleObject | |
| attr_accessor :foo, :bar, :moo, :goo | |
| end | |
| class App < Sinatra::Base | |
| register Padrino::Helpers | |
| configure do | |
| enable :inline_templates | |
| end | |
| get '/' do | |
| @foobar = SimpleObject.new | |
| erb :index | |
| end | |
| get '/notbugged' do | |
| @foobar = SimpleObject.new | |
| erb :not_bugged | |
| end | |
| end | |
| App.run! | |
| __END__ | |
| @@ layout | |
| <html> | |
| <body> | |
| <%= link_to 'bugged', '/' %> | |
| <%= link_to 'not bugged', '/notbugged' %> | |
| <hr> | |
| <%= yield %> | |
| </body> | |
| </html> | |
| @@ index | |
| <% form_for @foobar, '/', :method => :put do |f| %> | |
| testytest | |
| <% end %> | |
| @@ not_bugged | |
| | |
| <% form_for @foobar, '/', :method => :put do |f| %> | |
| testytest | |
| <% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment