Skip to content

Instantly share code, notes, and snippets.

@zenlor
Created April 15, 2011 12:48
Show Gist options
  • Select an option

  • Save zenlor/921638 to your computer and use it in GitHub Desktop.

Select an option

Save zenlor/921638 to your computer and use it in GitHub Desktop.
app.rb
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
&nbsp;
<% 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